Add migration for pre 1.14 to 1.14+

This commit is contained in:
2021-04-23 15:04:21 +02:00
committed by dev03
parent 92b70e73d5
commit 299a67b152

View File

@@ -27,6 +27,10 @@ stringData:
{{- $_ := set .Values.gitea.config "security" dict -}}
{{- end -}}
{{- if not .Values.gitea.config.repository -}}
{{- $_ := set .Values.gitea.config "repository" dict -}}
{{- end -}}
{{- /* security default settings */ -}}
{{- if not .Values.gitea.config.security.INSTALL_LOCK -}}
{{- $_ := set .Values.gitea.config.security "INSTALL_LOCK" "true" -}}

View File

@@ -21,6 +21,14 @@ stringData:
chmod -R 700 /data/git/.ssh
mkdir -p /data/gitea/conf
{{- if and (not .Values.gitea.config.repository.ROOT) (.Values.gitea.automigrate) }}
{{- if (semverCompare ">=1.14.0" .Values.image.tag) }}
if [ -d "/data/git/gitea-repositories" ]; then
mv /data/git/gitea-repositories /data/
fi
{{- end }}
{{- end }}
# Copy config file to writable volume
cp /etc/gitea/conf/app.ini /data/gitea/conf/app.ini
chmod a+rwx /data/gitea/conf/app.ini
@@ -34,6 +42,10 @@ stringData:
set -x; \
gitea migrate; \
{{- if and .Values.gitea.admin.username .Values.gitea.admin.password }}
gitea admin create-user --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }} --email {{ .Values.gitea.admin.email }} --admin --must-change-password=false \
|| \
gitea admin change-password --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }} \
|| \
gitea admin user create --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }} --email {{ .Values.gitea.admin.email }} --admin --must-change-password=false \
|| \
gitea admin user change-password --username {{ .Values.gitea.admin.username }} --password {{ .Values.gitea.admin.password | quote }}; \

View File

@@ -8,9 +8,9 @@ clusterDomain: cluster.local
image:
repository: gitea/gitea
tag: 1.13.7
tag: 1.14.1
pullPolicy: Always
rootless: false # only possible when running 1.14 or later
rootless: true # only possible when running 1.14 or later
imagePullSecrets: []
@@ -121,6 +121,8 @@ gitea:
password: r8sA8CPHD9!bt6d
email: "gitea@local.domain"
automigrate: true
metrics:
enabled: false
serviceMonitor: