gitea/manifests/common/createadmin.yaml

40 lines
1.0 KiB
YAML
Raw Normal View History

2024-12-22 05:08:23 +00:00
---
apiVersion: batch/v1
kind: Job
metadata:
name: "createadmin-$NAME"
spec:
template:
spec:
restartPolicy: Never
containers:
- name: createuser
image: "$IMAGEAPP"
envFrom:
- secretRef:
name: "$SECRET"
2024-12-22 05:08:23 +00:00
command:
- bash
- -c
2024-12-22 06:37:39 +00:00
- 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" \
2024-12-22 05:08:23 +00:00
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