gitea/manifests/common/createadmin.yaml
ange bd449faec1
Some checks failed
/ deploy (push) Failing after 2m48s
feat: renovatebot
2024-12-22 05:08:23 +00:00

38 lines
997 B
YAML

---
apiVersion: batch/v1
kind: Job
metadata:
name: "createadmin-$NAME"
spec:
template:
spec:
restartPolicy: Never
containers:
- name: createuser
image: "$IMAGEAPP"
command:
- bash
- -c
- |
gitea admin user change-password --must-change-password=false \
--username "$NAME" \
--password "$PASS" 2> /dev/null \
|| gitea admin user create --admin --must-change-password=false \
--email "$EMAIL" \
--username "$NAME" \
--password "$PASS"
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