From b3ada6afc0b466ba6eda77b927b7a09e2082f09b Mon Sep 17 00:00:00 2001 From: casjay Date: Fri, 6 Sep 2024 20:07:50 -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 | 6 ++++-- 1 file changed, 4 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 f68dd2c..fc52f00 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 @@ -247,16 +247,18 @@ __run_pre_execute_checks() { #!/usr/bin/env bash # Edit this file and execute it exitStatus=1 -RUNNER_NAME="\$(hostname -f)" RUNNER_HOME="\$HOME/.config/act_runner" +RUNNER_NAME="\$(hostname -f|sed 's|[.]|_|g')" RUNNER_REGISTER_URL="https://$INSTANCE_HOSTNAME" RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}" RUNNER_LABELS="$RUNNER_LABELS" ACT_API_URL="\$(curl -q -LSsf -X 'GET' 'https://gitea.com/api/v1/repos/gitea/act_runner/releases/latest' -H 'accept: application/json' | jq '.[]' | jq -rc '.[].browser_download_url' 2>/dev/null)" +echo "Installing act_runner" mkdir -p "\$RUNNER_HOME" case "\$(uname -m)" in x86_64) ACT_API_URL="\$(echo "\$ACT_API_URL" | grep 'linux.*amd64$')" ;; aarch64) ACT_API_URL="(echo "\$ACT_API_URL"|grep 'linux.*aarch64$')" ;; *) echo "\$(uname -m) is not supported by this script" >&2 && exit 1 ;; esac if [ -n "\$ACT_API_URL" ]; then - curl -q -LSsf "\$ACT_API_URL" -o "/usr/local/bin/act_runner" && chmod -Rf 755 "/usr/local/bin/act_runner" + [ -n "\$(type -P act_runner)" ] || curl -q -LSsf "\$ACT_API_URL" -o "/usr/local/bin/act_runner" && chmod -Rf 755 "/usr/local/bin/act_runner" + [ -n "\$(type -P act_runner)" ] || { echo "Failed to download act_runner from: \$ACT_API_URL" && exit 1; } [ -f "\$RUNNER_HOME/config.yaml" ] || act_runner generate-config >"\$RUNNER_HOME/config.yaml" act_runner register --config "\$RUNNER_HOME/config.yaml" --labels "\$RUNNER_LABELS" --name "\$RUNNER_NAME" --instance "\$RUNNER_REGISTER_URL" --token "\$RUNNER_AUTH_TOKEN" --no-interactive && exitStatus=0 if [ "\$exitStatus" -eq 0 ]; then