khuedoan-homelab/platform/gitea/templates/config-job.yaml
2023-01-26 01:26:52 +07:00

53 lines
1.5 KiB
YAML

apiVersion: batch/v1
kind: CronJob
metadata:
name: gitea-config
namespace: {{ .Release.Namespace }}
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
schedule: '*/5 * * * *'
concurrencyPolicy: Forbid
jobTemplate:
spec:
backoffLimit: 3
template:
spec:
restartPolicy: Never
containers:
- name: apply
image: golang:1.19-alpine
env:
- name: GITEA_HOST
value: http://gitea-http:3000
- name: GITEA_USER
valueFrom:
secretKeyRef:
name: gitea-admin-secret
key: username
- name: GITEA_PASSWORD
valueFrom:
secretKeyRef:
name: gitea-admin-secret
key: password
- name: WEBHOOK_TOKEN
valueFrom:
secretKeyRef:
name: gitea-webhook-secret
key: token
workingDir: /go/src/gitea-config
command:
- sh
- -c
args:
- |
go get .
go run .
volumeMounts:
- name: source
mountPath: /go/src/gitea-config
volumes:
- name: source
configMap:
name: gitea-config-source