{{/* Create helm partial for gitea server */}} {{- define "init" }} - name: init image: {{ .Values.images.gitea }} imagePullPolicy: {{ .Values.images.pullPolicy }} env: - name: MARIADB_PASSWORD valueFrom: secretKeyRef: name: {{ template "mariadb.fullname" . }} key: mariadb-password - name: SCRIPT value: &script |- mkdir -p /datatmp/gitea/conf if [ ! -f /datatmp/gitea/conf/app.ini ]; then sed "s/MARIADB_PASSWORD/${MARIADB_PASSWORD}/g" < /etc/gitea/app.ini > /datatmp/gitea/conf/app.ini fi command: ["/bin/sh",'-c', *script] volumeMounts: - name: gitea-data mountPath: /datatmp - name: gitea-config mountPath: /etc/gitea {{- end }}