Skip to content

Commit

Permalink
Add new option for opt-out auto update (#14)
Browse files Browse the repository at this point in the history
* 📝 Update README.md

This commit is to update README.md which add new option of opt-out
update to latest version.

* 💥 add feature of disabling auto update

This commit is to support feature which opt-out auto update.
  • Loading branch information
kuju63 authored Mar 21, 2022
1 parent bed3cf3 commit c87ed84
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ ENV http_proxy="" \
runner_name="" \
label="" \
group="" \
tls_no_verify=0
tls_no_verify=0 \
disable_auto_update=0

WORKDIR /actions-runner

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@ Add runner to specified self-hosted runner group. Self-hosted runner group is us
### tls_no_verify[Optional]

Disable verify process for SSL/TLS. When Proxy server using self-signed certificate, this option is need to set "1".

### disable_auto_update [Optional]

Opt-out auto-update to the latest runner version. Use this option, this is need to set "0".
actions/runner

Details see [GitHub Docs (Controlling runner software updates on self-hosted runners)](https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#controlling-runner-software-updates-on-self-hosted-runners)
10 changes: 8 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ if [ ! -f "./.credentials" ]; then
bash ./autoconf.sh
fi

DISABLE_UPDATE=""
if [ "${disable_auto_update}" = "1" ]; then
DISABLE_UPDATE="--disableupdate"
echo "Opt-out auto update"
fi

shutdown_handler() {
echo "Start shutdown process"
./config.sh remove --token "$TOKEN"
}

./run.sh &
./run.sh $DISABLE_UPDATE &
pid="$!"
trap '"shutdown_handler $pid"' SIGTERM
trap 'shutdown_handler' $pid 2 3 15
while kill -0 $pid > /dev/null 2>&1; do
wait
done

0 comments on commit c87ed84

Please sign in to comment.