Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/sonarqube/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All changes to this chart will be documented in this file.
* Upgrade nginx subchart to 4.12.2
* Support Kubernetes v1.32
* Add the possibility of to save the data with hostpath
* Allow persistence for plugins when installing both via values and marketplace

## [2025.3.0]
* Update Chart's version to 2025.3.0
Expand Down
4 changes: 2 additions & 2 deletions charts/sonarqube/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.plugins.install }}
{{- if or .Values.plugins.install .Values.persistence.enabled }}
- name: install-plugins
image: {{ default (include "sonarqube.image" $) .Values.plugins.image }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand Down Expand Up @@ -440,7 +440,7 @@ spec:
- key: init_fs.sh
path: init_fs.sh
{{- end }}
{{- if .Values.plugins.install }}
{{- if or .Values.plugins.install .Values.persistence.enabled }}
- name: install-plugins
configMap:
name: {{ include "sonarqube.fullname" . }}-install-plugins
Expand Down
26 changes: 22 additions & 4 deletions charts/sonarqube/templates/install-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,28 @@ metadata:
labels: {{- include "sonarqube.labels" . | nindent 4 }}
data:
install_plugins.sh: |-
cd {{ .Values.sonarqubeFolder }}/extensions/plugins
if [ -f "installed-plugins.txt" ]; then
echo "Found existing installed-plugins.txt. Cleaning up old files..."

while IFS= read -r plugin_file; do
if [ -f "$plugin_file" ]; then
echo "Deleting $plugin_file..."
rm -f "$plugin_file"
else
echo "File $plugin_file not found, skipping..."
fi
done < installed-plugins.txt

rm -f installed-plugins.txt
else
echo "installed-plugins.txt not found. Deleting all files in the folder..."
rm -f ./*
fi

touch installed-plugins.txt
{{- if .Values.plugins.install }}
rm -f {{ .Values.sonarqubeFolder }}/extensions/plugins/*
cd {{ .Values.sonarqubeFolder }}/extensions/plugins
{{- range $index, $val := .Values.plugins.install }}
curl {{ if $.Values.plugins.noCheckCertificate }}--insecure{{ end }} {{ if $.Values.plugins.netrcCreds }}--netrc-file /root/.netrc{{ end }} -fsSLO {{ $val | quote }}
curl {{ if $.Values.plugins.noCheckCertificate }}--insecure{{ end }} {{ if $.Values.plugins.netrcCreds }}--netrc-file /root/.netrc{{ end }} -fsSLO {{ $val | quote }} && echo "$(basename {{ $val | quote }})" >> installed-plugins.txt
{{- end }}
{{- end }}
{{- end }}