🗃️ Committing everything that changed 🗃️

rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
This commit is contained in:
casjay 2024-08-11 17:15:42 -04:00
parent 93f1dbd185
commit 9f22a03c19
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145

View File

@ -247,7 +247,6 @@ CONTAINER_IP4_ADDRESS="${HOSTNAME}"
EOF EOF
fi fi
for runner in "$CONF_DIR/reg"/*.reg; do for runner in "$CONF_DIR/reg"/*.reg; do
exitStatus=0
unset RUNNER_HOME RUNNER_NAME unset RUNNER_HOME RUNNER_NAME
RUNNER_NAME="$(basename "${runner//.reg/}")" RUNNER_NAME="$(basename "${runner//.reg/}")"
RUNNER_HOME="${RUNNER_HOME:-$CONF_DIR/multi/$RUNNER_NAME}" RUNNER_HOME="${RUNNER_HOME:-$CONF_DIR/multi/$RUNNER_NAME}"
@ -275,15 +274,13 @@ EOF
__replace "REPLACE_RUNNER_HOME" "$RUNNER_HOME" "$RUNNER_HOME/$RUNNER_NAME.yaml" __replace "REPLACE_RUNNER_HOME" "$RUNNER_HOME" "$RUNNER_HOME/$RUNNER_NAME.yaml"
act_runner register --config "$RUNNER_HOME/daemon.yaml" --labels "$RUNNER_LABELS" --name "$RUNNER_NAME" --instance "http://$CONTAINER_IP4_ADDRESS:8000" --token "$RUNNER_AUTH_TOKEN" --no-interactive && exitStatus=0 || exitStatus=1 act_runner register --config "$RUNNER_HOME/daemon.yaml" --labels "$RUNNER_LABELS" --name "$RUNNER_NAME" --instance "http://$CONTAINER_IP4_ADDRESS:8000" --token "$RUNNER_AUTH_TOKEN" --no-interactive && exitStatus=0 || exitStatus=1
if [ $exitStatus -eq 0 ]; then if [ $exitStatus -eq 0 ]; then
exitStatus=0
cp -Rf "$runner" "$RUNNER_HOME/$RUNNER_NAME.reg" cp -Rf "$runner" "$RUNNER_HOME/$RUNNER_NAME.reg"
chown -Rf "$SERVICE_USER":"$SERVICE_GROUP" "$RUNNER_HOME" chown -Rf "$SERVICE_USER":"$SERVICE_GROUP" "$RUNNER_HOME"
echo "$!" >"$RUN_DIR/act_runner.$RUNNER_NAME.pid"
echo "$RUNNER_NAME has been registered" echo "$RUNNER_NAME has been registered"
break break
else else
[ -f "$RUN_DIR/act_runner.$RUNNER_NAME.pid" ] && rm -f "$RUN_DIR/act_runner.$RUNNER_NAME.pid" [ -f "$RUN_DIR/act_runner.$RUNNER_NAME.pid" ] && rm -f "$RUN_DIR/act_runner.$RUNNER_NAME.pid"
exitStatus=1 exitStatus=$((exitStatus++))
sleep 20 sleep 20
fi fi
fi fi