gitea/manifests/common/job.yaml
2024-05-10 11:36:32 +02:00

36 lines
1009 B
YAML

---
apiVersion: batch/v1
kind: Job
metadata:
name: createadminuser
spec:
template:
spec:
restartPolicy: Never
containers:
- name: createadminuser
image: "$IMAGEAPP"
envFrom:
- secretRef:
name: gitea-admin
command:
- bash
- -c
- 'gitea migrate && { gitea admin user change-password --username "$username" --password "$password" 2> /dev/null || gitea admin user create --admin --email "$email" --username "$username" --password "$password"; }'
volumeMounts:
- name: config
mountPath: /etc/gitea/app.ini
subPath: app.ini
readOnly: true
- name: secrets
mountPath: /etc/gitea/secrets/
readOnly: true
volumes:
- name: config
configMap:
name: gitea-config
- name: secrets
secret:
secretName: gitea-secrets
backoffLimit: 4