gitea/manifests/common/createadmin.yaml
ange 0fd5175a1d
Some checks failed
/ deploy (push) Failing after 1m43s
fix: create user from secret instead of env
2024-12-22 06:15:20 +00:00

41 lines
1.0 KiB
YAML

---
apiVersion: batch/v1
kind: Job
metadata:
name: "createadmin-$NAME"
spec:
template:
spec:
restartPolicy: Never
containers:
- name: createuser
image: "$IMAGEAPP"
envFrom:
- secretRef:
name: "$SECRET"
command:
- bash
- -c
- |
gitea admin user change-password --must-change-password=false
--username "$username"
--password "$password"
|| gitea admin user create --admin --must-change-password=false
--email "$email"
--username "$username"
--password "$password"
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
backoffLimit: 4