-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
27 lines (22 loc) · 854 Bytes
/
start.sh
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
#!/bin/bash
if [[ ! -v REPOSITORY ]]; then
echo "REPOSITORY env variable not set, should be in the format of a URL e.g. https://github.com/energinet-datahub/eo-selfhosted-runner"
exit 1;
fi
if [[ ! -v TOKEN ]]; then
echo "TOKEN env variable not set, is generated on the GitHub API or WebSite."
exit 1;
fi
if [[ ! -v NAME ]]; then
echo "NAME env variable not set, replaces existing runner with same name, since the container is ephemeral."
exit 1;
fi
if [[ ! -v LABELS ]]; then
echo "Configure without labels."
./config.sh --ephemeral --unattended --url ${REPOSITORY} --token ${TOKEN} --replace --name ${NAME}
else
echo "Configure with labels: ${LABELS}"
./config.sh --ephemeral --unattended --url ${REPOSITORY} --token ${TOKEN} --replace --name ${NAME} --labels ${LABELS}
fi
echo "Starting runner.."
./run.sh