44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: gitea-runner-config
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
labels:
|
|
{{- include "gitea.labels" . | nindent 4 }}
|
|
data:
|
|
config.yaml: |-
|
|
{{ toYaml .Values.runner.config | nindent 4 }}
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: gitea-runner-entrypoint
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
labels:
|
|
{{- include "gitea.labels" . | nindent 4 }}
|
|
data:
|
|
runner-entrypoint.sh: |-
|
|
#!/bin/sh
|
|
set -eu
|
|
|
|
case "${GITEA_RUNNER_REGISTRATION_TOKEN:-}" in
|
|
""|GENERATED_*)
|
|
echo "GITEA_RUNNER_REGISTRATION_TOKEN is not configured in Kubernetes secret"
|
|
echo "Patch secret gitea-secret key runner-registration-token and restart this pod"
|
|
exec tail -f /dev/null
|
|
;;
|
|
esac
|
|
|
|
if [ ! -f /data/.runner ]; then
|
|
echo "Registering Gitea runner ${GITEA_RUNNER_NAME} ..."
|
|
act_runner register --no-interactive \
|
|
--instance "${GITEA_INSTANCE_URL}" \
|
|
--token "${GITEA_RUNNER_REGISTRATION_TOKEN}" \
|
|
--name "${GITEA_RUNNER_NAME}" \
|
|
--labels "${GITEA_RUNNER_LABELS}" \
|
|
--config /config.yaml
|
|
fi
|
|
|
|
echo "Starting Gitea runner daemon"
|
|
exec act_runner daemon --config /config.yaml
|