From 1cf9fb1172239f90e281c87f859fe002ebc84fe7 Mon Sep 17 00:00:00 2001 From: casjay Date: Sun, 1 Sep 2024 17:37:21 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh --- rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh index 111c91f..95a7242 100755 --- a/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh +++ b/rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh @@ -266,6 +266,12 @@ RUNNER_LABELS="$RUNNER_LABELS" EOF fi + if [ -f "$CONF_DIR/daemon.yaml" ]; then + if [ ! -f "$CONF_DIR/runners" ]; then + act_runner register --config "$CONF_DIR/daemon.yaml" --labels "$RUNNER_LABELS" --name "gitea" --instance "http://127.0.0.1:8000" --token "$SYS_AUTH_TOKEN" --no-interactive 2>/dev/stdout + fi + fi + for runner in "$CONF_DIR/reg"/*.reg; do while :; do [ -f "$runner" ] && . "$runner" @@ -279,7 +285,7 @@ EOF RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}" RUNNER_LABELS="${RUNNER_LABELS:-act_runner}" [ -n "$RUNNER_NAME" ] && [ -n "$RUNNER_HOME" ] || break - if [ -n "$RUNNER_AUTH_TOKEN" ]; then + if [ -z "$RUNNER_AUTH_TOKEN" ]; then RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}" echo "$RUNNER_AUTH_TOKEN" >"$CONF_DIR/tokens/$RUNNER_NAME" chmod -Rf 600 "$CONF_DIR/tokens/system" "$CONF_DIR/tokens/$RUNNER_NAME" 2>/dev/null @@ -288,7 +294,6 @@ EOF echo "Then edit $runner or set in $CONF_DIR/tokens/$RUNNER_NAME" >&2 sleep 120 else - [ -f "$runner" ] && . "$runner" echo "creating $RUNNER_NAME in $RUNNER_HOME and registering with $RUNNER_REGISTER_URL" mkdir -p "$RUNNER_HOME" [ -f "$RUNNER_HOME/daemon.yaml" ] || copy "$ETC_DIR/multi.yaml" "$RUNNER_HOME/daemon.yaml"