-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
28 lines (19 loc) · 721 Bytes
/
start.sh
File metadata and controls
28 lines (19 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
ACCESS_TOKEN=${token}
GitHub_url=${url}
REG_TOKEN=$(curl -k -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
$GitHub_url/api/v3/enterprises/valeo-sa/actions/runners/registration-token | jq -r .token)
export GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY=1
export GIT_SSL_NO_VERIFY=1
cd /home/runner/actions-runner
./config.sh --url $GitHub_url/enterprises/valeo-sa --token ${REG_TOKEN} --ephemeral --disableupdate --name "aws-runner-$(hostname)" --runnergroup all --work _work
cleanup() {
echo "Removing runner..."
./config.sh remove --unattended --token ${REG_TOKEN}
}
trap 'cleanup; exit 130' INT
trap 'cleanup; exit 143' TERM
./run.sh & wait $!