🗃️ 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:39:52 -04:00
parent 9f22a03c19
commit ef8f78c1ae
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145

View File

@ -232,7 +232,7 @@ RUNNER_HOME="$CONF_DIR/multi/runner-1"
RUNNER_LABELS="$RUNNER_LABELS" RUNNER_LABELS="$RUNNER_LABELS"
RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}" RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}"
RUNNER_HOSTNAME="http://${HOSTNAME:-127.0.0.1:8000}" RUNNER_HOSTNAME="http://${HOSTNAME:-127.0.0.1:8000}"
CONTAINER_IP4_ADDRESS="${HOSTNAME}" CONTAINER_IP4_ADDRESS="127.0.0.1:8000"
EOF EOF
cat <<EOF >"$CONF_DIR/reg/runner-2.reg" cat <<EOF >"$CONF_DIR/reg/runner-2.reg"
@ -242,7 +242,7 @@ RUNNER_HOME="$CONF_DIR/multi/runner-2"
RUNNER_LABELS="$RUNNER_LABELS" RUNNER_LABELS="$RUNNER_LABELS"
RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}" RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}"
RUNNER_HOSTNAME="http://${HOSTNAME:-127.0.0.1:8000}" RUNNER_HOSTNAME="http://${HOSTNAME:-127.0.0.1:8000}"
CONTAINER_IP4_ADDRESS="${HOSTNAME}" CONTAINER_IP4_ADDRESS="127.0.0.1:8000"
EOF EOF
fi fi
@ -258,7 +258,7 @@ EOF
[ -f "$CONF_DIR/tokens/$RUNNER_NAME" ] && RUNNER_AUTH_TOKEN="$(<"$CONF_DIR/tokens/$RUNNER_NAME")" || { [ -n "$SYS_AUTH_TOKEN" ] && echo "$SYS_AUTH_TOKEN" >"$CONF_DIR/tokens/$RUNNER_NAME"; } [ -f "$CONF_DIR/tokens/$RUNNER_NAME" ] && RUNNER_AUTH_TOKEN="$(<"$CONF_DIR/tokens/$RUNNER_NAME")" || { [ -n "$SYS_AUTH_TOKEN" ] && echo "$SYS_AUTH_TOKEN" >"$CONF_DIR/tokens/$RUNNER_NAME"; }
chmod -Rf 600 "$CONF_DIR/tokens/system" "$CONF_DIR/tokens/$RUNNER_NAME" 2>/dev/null chmod -Rf 600 "$CONF_DIR/tokens/system" "$CONF_DIR/tokens/$RUNNER_NAME" 2>/dev/null
chown -Rf "$SERVICE_USER":"$SERVICE_GROUP" "$CONF_DIR" "$ETC_DIR" "$DATA_DIR" 2>/dev/null chown -Rf "$SERVICE_USER":"$SERVICE_GROUP" "$CONF_DIR" "$ETC_DIR" "$DATA_DIR" 2>/dev/null
echo "Error: RUNNER_AUTH_TOKEN is not set - visit $INSTANCE_HOSTNAME/admin/actions/runners" >&2 echo "Error: RUNNER_AUTH_TOKEN is not set - visit $RUNNER_HOSTNAME/admin/actions/runners" >&2
echo "Then edit $runner or set in $CONF_DIR/tokens/$RUNNER_NAME" >&2 echo "Then edit $runner or set in $CONF_DIR/tokens/$RUNNER_NAME" >&2
sleep 120 sleep 120
else else
@ -272,7 +272,7 @@ EOF
cp -Rf "$CONF_DIR/multi.yaml" "$RUNNER_HOME/daemon.yaml" cp -Rf "$CONF_DIR/multi.yaml" "$RUNNER_HOME/daemon.yaml"
__replace "REPLACE_RUNNER_TEMP" "$TMP_DIR/$RUNNER_NAME" "$RUNNER_HOME/$RUNNER_NAME.yaml" __replace "REPLACE_RUNNER_TEMP" "$TMP_DIR/$RUNNER_NAME" "$RUNNER_HOME/$RUNNER_NAME.yaml"
__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" --token "$RUNNER_AUTH_TOKEN" --no-interactive && exitStatus=0 || exitStatus=1
if [ $exitStatus -eq 0 ]; then if [ $exitStatus -eq 0 ]; then
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"