gitea/manifests/common/job.yaml

34 lines
1002 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" --must-change-password=false 2> /dev/null || gitea admin user create --admin --email "$email" --username "$username" --password "$password" --must-change-password=false; }'
volumeMounts:
- name: config
mountPath: /etc/gitea/app.ini
subPath: app.ini
- name: secrets
mountPath: /etc/gitea/secrets/
volumes:
- name: config
configMap:
name: gitea
- name: secrets
secret:
secretName: gitea-secrets
backoffLimit: 4