From 0f4289bf5d6f0716e6d9f2b835ca0973209bd52b Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 2 Sep 2024 14:15:15 -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 | 11 +++++------ 1 file changed, 5 insertions(+), 6 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 bf9efa2..8038f74 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 @@ -283,10 +283,10 @@ RUNNER_LABELS="$RUNNER_LABELS" EOF fi - mkdir -p "$RUNNER_DEFAULT_HOME" + mkdir -p "$RUNNER_DEFAULT_HOME" "$TMP_DIR/runners/gitea" [ -f "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" ] || copy "$RUNNER_CONFIG_DEFAULT" "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" if [ -n "$SYS_AUTH_TOKEN" ] && [ ! -f "$ETC_DIR/runners" ] && [ -f "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" ]; then - __replace "REPLACE_RUNNER_TEMP" "$TMP_DIR/gitea" "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" + __replace "REPLACE_RUNNER_TEMP" "$TMP_DIR/runners/gitea" "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" __replace "REPLACE_RUNNER_HOME" "$RUNNER_DEFAULT_HOME" "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" __replace "REPLACE_RUNNER_CACHE_HOST" "$RUNNER_CACHE_HOST" "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" __replace "REPLACE_RUNNER_CACHE_PORT" "$RUNNER_CACHE_PORT" "$RUNNER_DEFAULT_HOME/$RUNNER_CONFIG_NAME" @@ -306,8 +306,7 @@ EOF # echo "Initializing $RUNNER_NAME in $RUNNER_HOME" # - [ -d "$RUNNER_HOME" ] || mkdir -p "$RUNNER_HOME" - [ -d "$CONF_DIR/tokens" ] || mkdir -p "$CONF_DIR/tokens" + [ -d "$CONF_DIR/tokens" ] || mkdir -p "$RUNNER_HOME" "$CONF_DIR/tokens" "$TMP_DIR/runners/$RUNNER_NAME" [ -f "$CONF_DIR/tokens/system" ] && { grep -qs '.' "$CONF_DIR/tokens/system" || rm -Rf "$CONF_DIR/tokens/system"; } [ -f "$CONF_DIR/tokens/$RUNNER_NAME" ] && { grep -qs "$CONF_DIR/tokens/$RUNNER_NAME" || rm -Rf "$CONF_DIR/tokens/$RUNNER_NAME"; } # @@ -328,10 +327,10 @@ EOF echo "creating $RUNNER_NAME in $RUNNER_HOME and registering with $RUNNER_HOSTNAME" [ -f "$RUNNER_HOME/$RUNNER_CONFIG_NAME" ] || copy "$RUNNER_CONFIG_DEFAULT" "$RUNNER_HOME/$RUNNER_CONFIG_NAME" __replace "REPLACE_RUNNER_HOME" "$RUNNER_HOME" "$RUNNER_HOME/$RUNNER_CONFIG_NAME" - __replace "REPLACE_RUNNER_TEMP" "$TMP_DIR/$RUNNER_NAME" "$RUNNER_HOME/$RUNNER_CONFIG_NAME" + __replace "REPLACE_RUNNER_TEMP" "$TMP_DIR/runners/$RUNNER_NAME" "$RUNNER_HOME/$RUNNER_CONFIG_NAME" __replace "REPLACE_RUNNER_CACHE_HOST" "$RUNNER_CACHE_HOST" "$RUNNER_HOME/$RUNNER_CONFIG_NAME" __replace "REPLACE_RUNNER_CACHE_PORT" "$RUNNER_CACHE_PORT" "$RUNNER_HOME/$RUNNER_CONFIG_NAME" - if grep -sq "$RUNNER_HOME" "$RUNNER_HOME/$RUNNER_CONFIG_NAME" && grep -sq "$TMP_DIR/$RUNNER_NAME" "$RUNNER_HOME/$RUNNER_CONFIG_NAME"; then + if grep -sq "$RUNNER_HOME" "$RUNNER_HOME/$RUNNER_CONFIG_NAME" && grep -sq "$TMP_DIR/runners/$RUNNER_NAME" "$RUNNER_HOME/$RUNNER_CONFIG_NAME"; then act_runner register --config "$RUNNER_HOME/$RUNNER_CONFIG_NAME" --labels "$RUNNER_LABELS" --name "$RUNNER_NAME" --instance "$RUNNER_REGISTER_URL" --token "$RUNNER_AUTH_TOKEN" --no-interactive 2>/dev/stdout if [ $? -eq 0 ] || [ -f "$RUNNER_HOME/runners" ]; then copy "$runner" "$RUNNER_HOME/$RUNNER_NAME.reg"