36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
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
|
|
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
|