Created
August 12, 2021 07:10
-
-
Save CreedsCode/3134e494fe62c5d55b2d66f3c95e2809 to your computer and use it in GitHub Desktop.
start.sh for github runner, to be able to curl it in the dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ORGANIZATION=$ORGANIZATION | |
ACCESS_TOKEN=$ACCESS_TOKEN | |
REG_TOKEN=$(curl -sX POST -H "Authorization: token ${ACCESS_TOKEN}" https://api.github.com/orgs/${ORGANIZATION}/actions/runners/registration-token | jq .token --raw-output) | |
cd /home/docker/actions-runner | |
./config.sh --url https://github.com/${ORGANIZATION} --token ${REG_TOKEN} | |
cleanup() { | |
echo "Removing runner..." | |
./config.sh remove --unattended --token ${REG_TOKEN} | |
} | |
trap 'cleanup; exit 130' INT | |
trap 'cleanup; exit 143' TERM | |
./run.sh & wait $! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment