mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/sonarqube] Sonarqube configmap fix (#5064)
* Fix configmap mounting * Bump chart version * Update sonarqube startup * Bump chart version * Fix startup script
This commit is contained in:
committed by
k8s-ci-robot
parent
f7745ea5cb
commit
df6977d077
@@ -1,6 +1,6 @@
|
||||
name: sonarqube
|
||||
description: Sonarqube is an open sourced code quality scanning tool
|
||||
version: 0.5.0
|
||||
version: 0.5.1
|
||||
appVersion: 6.7.3
|
||||
keywords:
|
||||
- coverage
|
||||
|
||||
@@ -24,13 +24,20 @@ spec:
|
||||
- name: {{ $key }}
|
||||
value: {{ $value }}
|
||||
{{- end }}
|
||||
command: ["sh", "-c", "/opt/sonarqube/extensions/plugins/install_plugins.sh"]
|
||||
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
|
||||
"
|
||||
]
|
||||
volumeMounts:
|
||||
- mountPath: /opt/sonarqube/extensions
|
||||
name: sonarqube
|
||||
subPath: extensions
|
||||
- name: install-plugins
|
||||
mountPath: /opt/sonarqube/extensions/plugins/install_plugins.sh
|
||||
mountPath: /tmp/scripts/
|
||||
resources:
|
||||
{{ toYaml .Values.plugins.resources | indent 12 }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
@@ -52,6 +59,15 @@ spec:
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.service.internalPort }}
|
||||
command: [
|
||||
"sh",
|
||||
"-ce",
|
||||
"mkdir /scripts &&
|
||||
cp /tmp-script/startup.sh /scripts/startup.sh &&
|
||||
chmod 0755 /scripts/startup.sh &&
|
||||
/scripts/startup.sh
|
||||
"
|
||||
]
|
||||
env:
|
||||
{{- range $key, $value := .Values.extraEnv }}
|
||||
- name: {{ $key }}
|
||||
@@ -83,9 +99,11 @@ spec:
|
||||
- mountPath: /opt/sonarqube/conf
|
||||
name: sonarqube
|
||||
subPath: conf
|
||||
- mountPath: /tmp-script/
|
||||
name: startup
|
||||
{{- if .Values.sonarProperties }}
|
||||
- name: config
|
||||
mountPath: /opt/sonarqube/conf/sonar.properties
|
||||
mountPath: /tmp/conf/
|
||||
{{- end}}
|
||||
- mountPath: /opt/sonarqube/data
|
||||
name: sonarqube
|
||||
@@ -108,12 +126,26 @@ spec:
|
||||
{{ toYaml .Values.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if .Values.sonarProperties}}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ template "sonarqube.fullname" . }}-config
|
||||
items:
|
||||
- key: sonar.properties
|
||||
path: sonar.properties
|
||||
{{- end }}
|
||||
- name: install-plugins
|
||||
configMap:
|
||||
name: {{ template "sonarqube.fullname" . }}-install-plugins
|
||||
items:
|
||||
- key: install_plugins.sh
|
||||
path: install_plugins.sh
|
||||
- name: startup
|
||||
configMap:
|
||||
name: {{ template "sonarqube.fullname" . }}-startup
|
||||
items:
|
||||
- key: startup.sh
|
||||
path: startup.sh
|
||||
- name: sonarqube
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "sonarqube.fullname" . }}-startup
|
||||
labels:
|
||||
app: {{ template "sonarqube.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
startup.sh: |-
|
||||
#! /bin/sh
|
||||
if [ -e /tmp/conf/sonar.properties ]; then
|
||||
cp /tmp/conf/sonar.properties /opt/sonarqube/conf/sonar.properties
|
||||
fi
|
||||
/opt/sonarqube/bin/run.sh
|
||||
Reference in New Issue
Block a user