-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgithub-runner.bash
More file actions
executable file
·34 lines (25 loc) · 943 Bytes
/
github-runner.bash
File metadata and controls
executable file
·34 lines (25 loc) · 943 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
29
30
31
32
33
34
# Install jq
# apt-get install jq -y
# Get token from
ls -la
exit 0
curl -O https://storage.googleapis.com/artifacts.playground.napptive.dev/installer.sh && bash installer.sh
playground login --pat
RESPONSE=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_PAT" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/$ORG/actions/runners/registration-token)
echo $RESPONSE
TOKEN=$(echo $RESPONSE | jq -r '.token')
sed -i "s/__TOKEN__/$TOKEN/g" param-file.yaml
sed -i "s/__ORGANIZATION__/$ORG/g" param-file.yaml
playground env use "$PLAYGROUND_ACCOUNT_NAME/$ENV"
# check if previous cmd throw error
if [ $? -ne 0 ]; then
playground env create "$PLAYGROUND_ACCOUNT_NAME/$ENV"
echo "ENVIRONMENT CREATED: $PLAYGROUND_ACCOUNT_NAME/$ENV"
fi
# Deploy Github runner
playground catalog deploy napptive/github-runner:2.298.2 --setParametersFromFile param-file.yaml