Rebase all into one commit. I should have used a branch
Trying out a readiness check Added init-container for dind Use a more graceful netcat command Slimmed some things down Added docker cli and use that for its readiness check fix: unittest Added parameter for deploying multiple runners Fix unittest job remove reference nc command remove reference in unittest again Trying to fix unittests Passing unit tests readme update readme making using pnpm
This commit is contained in:
@@ -113,19 +113,3 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{/*
|
||||
Parse the http url to hostname + port separated by space for the nc command
|
||||
*/}}
|
||||
{{- define "gitea.actions.nc" -}}
|
||||
{{- $url := include "gitea.actions.local_root_url" . | urlParse -}}
|
||||
{{- $host := get $url "host" -}}
|
||||
{{- $scheme := get $url "scheme" -}}
|
||||
{{- $port := "80" -}}
|
||||
{{- if contains ":" $host -}}
|
||||
{{- $hostAndPort := regexSplit ":" $host 2 -}}
|
||||
{{- $host = index $hostAndPort 0 -}}
|
||||
{{- $port = index $hostAndPort 1 -}}
|
||||
{{- else if eq $scheme "https" -}}
|
||||
{{- $port = "443" -}}
|
||||
{{- else if eq $scheme "http" -}}
|
||||
{{- $port = "80" -}}
|
||||
{{- end -}}
|
||||
{{- printf "%s %s" $host $port -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -36,8 +36,9 @@ spec:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
while ! nc -z {{ include "gitea.actions.nc" . }}; do
|
||||
sleep 5
|
||||
echo 'Waiting for gitea...'
|
||||
while ! wget -qO- {{ include "gitea.actions.local_root_url" . }} > /dev/null; do
|
||||
sleep 2
|
||||
done
|
||||
containers:
|
||||
- name: actions-token-create
|
||||
|
||||
@@ -16,6 +16,7 @@ metadata:
|
||||
name: {{ include "gitea.actions.fullname" . }}-act-runner
|
||||
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
||||
spec:
|
||||
replicas: {{ .Values.statefulset.replicas | default 1 }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "gitea.actions.selectorLabels.actRunner" . | nindent 6 }}
|
||||
@@ -36,14 +37,26 @@ spec:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
while ! nc -z {{ include "gitea.actions.nc" . }}; do
|
||||
sleep 5
|
||||
echo 'Waiting for gitea...'
|
||||
while ! wget -qO- {{ include "gitea.actions.local_root_url" . }} > /dev/null; do
|
||||
sleep 2
|
||||
done
|
||||
containers:
|
||||
- name: act-runner
|
||||
image: "{{ .Values.statefulset.actRunner.repository }}:{{ .Values.statefulset.actRunner.tag }}"
|
||||
imagePullPolicy: {{ .Values.statefulset.actRunner.pullPolicy }}
|
||||
workingDir: /data
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
apk add --no-cache docker-cli
|
||||
echo "Waiting for Docker daemon..."
|
||||
until docker info > /dev/null 2>&1; do
|
||||
sleep 2
|
||||
done
|
||||
echo "Docker is ready, starting act-runner..."
|
||||
exec run.sh
|
||||
env:
|
||||
- name: DOCKER_HOST
|
||||
value: tcp://127.0.0.1:2376
|
||||
|
||||
Reference in New Issue
Block a user