Skip to content

Commit

Permalink
[stable/sonarqube] Fix for issue helm#10195 (helm#10344)
Browse files Browse the repository at this point in the history
* correct overwriting plugins folder

Signed-off-by: Melissa Palmer <[email protected]>

* correct overwriting plugins folder

Signed-off-by: Melissa Palmer <[email protected]>
  • Loading branch information
melissapalmer authored and wgiddens committed Jan 18, 2019
1 parent 5d9aadf commit 395a6e7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 12 deletions.
4 changes: 2 additions & 2 deletions stable/sonarqube/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: sonarqube
description: Sonarqube is an open sourced code quality scanning tool
version: 0.11.0
appVersion: 6.7.6
version: 0.12.0
appVersion: 7.4
keywords:
- coverage
- security
Expand Down
16 changes: 16 additions & 0 deletions stable/sonarqube/templates/copy-plugins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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
cp /opt/sonarqube/extensions/plugins/tmp/*.jar /opt/sonarqube/extensions/plugins/
/opt/sonarqube/bin/run.sh
25 changes: 17 additions & 8 deletions stable/sonarqube/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ spec:
{{- end }}
command: ["sh",
"-c",
"mkdir -p /opt/sonarqube/extensions/plugins/ &&
cp /tmp/scripts/install_plugins.sh /opt/sonarqube/extensions/plugins/install_plugins.sh &&
chmod 0775 /opt/sonarqube/extensions/plugins/install_plugins.sh &&
/opt/sonarqube/extensions/plugins/install_plugins.sh
"mkdir -p /opt/sonarqube/extensions/plugins/tmp &&
cp /tmp/scripts/install_plugins.sh /opt/sonarqube/extensions/plugins/tmp/install_plugins.sh &&
chmod 0775 /opt/sonarqube/extensions/plugins/tmp/install_plugins.sh &&
/opt/sonarqube/extensions/plugins/tmp/install_plugins.sh && pwd && ls -lah
"
]
volumeMounts:
- mountPath: /opt/sonarqube/extensions
- mountPath: /opt/sonarqube/extensions/plugins/tmp
name: sonarqube
subPath: extensions
subPath: tmp
- name: install-plugins
mountPath: /tmp/scripts/
resources:
Expand Down Expand Up @@ -123,9 +123,11 @@ spec:
- mountPath: /opt/sonarqube/data
name: sonarqube
subPath: data
- mountPath: /opt/sonarqube/extensions
- mountPath: /opt/sonarqube/extensions/plugins/tmp
name: sonarqube
subPath: extensions
subPath: tmp
- name: copy-plugins
mountPath: /usr/local/
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.nodeSelector }}
Expand Down Expand Up @@ -155,6 +157,13 @@ spec:
items:
- key: install_plugins.sh
path: install_plugins.sh
- name: copy-plugins
configMap:
name: {{ template "sonarqube.fullname" . }}-copy-plugins
defaultMode: 0755
items:
- key: copy_plugins.sh
path: copy_plugins.sh
- name: startup
configMap:
name: {{ template "sonarqube.fullname" . }}-startup
Expand Down
2 changes: 1 addition & 1 deletion stable/sonarqube/templates/install-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
heritage: {{ .Release.Service }}
data:
install_plugins.sh: |-
cd /opt/sonarqube/extensions/plugins
cd /opt/sonarqube/extensions/plugins/tmp
{{- if .Values.plugins.install }}
{{- range $index, $val := .Values.plugins.install }}
wget {{ $val }} --no-check-certificate
Expand Down
2 changes: 1 addition & 1 deletion stable/sonarqube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
replicaCount: 1
image:
repository: sonarqube
tag: 6.7.6-community
tag: 7.4-community
# If using a private repository, the name of the imagePullSecret to use
# pullSecret: my-repo-secret
# Starting 6.7.6 and 7.4 official sonarqube docker image, command is not required
Expand Down

0 comments on commit 395a6e7

Please sign in to comment.