mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-22 12:03:55 +02:00
Added a first draft of a github runner
This commit is contained in:
20
runner/start.sh
Normal file
20
runner/start.sh
Normal file
@ -0,0 +1,20 @@
|
||||
#!/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 ${ACCESS_TOKEN}
|
||||
|
||||
cleanup() {
|
||||
echo "Removing runner..."
|
||||
./config.sh remove --unattended --token ${ACCESS_TOKEN}
|
||||
}
|
||||
|
||||
trap 'cleanup; exit 130' INT
|
||||
trap 'cleanup; exit 143' TERM
|
||||
|
||||
./run.sh & wait $!
|
Reference in New Issue
Block a user