apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "sonarqube.fullname" . }}-copy-plugins
  labels:
    app: {{ template "sonarqube.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
data:
  copy_plugins.sh: |-
      #! /bin/sh
      {{- if .Values.plugins.deleteDefaultPlugins }}
      rm -f /opt/sonarqube/extensions/plugins/*.jar
      {{- end }}
      cp /opt/sonarqube/extensions/plugins/tmp/*.jar /opt/sonarqube/extensions/plugins/
      /opt/sonarqube/bin/run.sh
    
    