-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·35 lines (29 loc) · 913 Bytes
/
entrypoint.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
28
29
30
31
32
33
34
35
#!/bin/sh
set -x
if ! sudo chown root:docker /var/run/docker.sock; then
echo "NOTE: We don't have a Docker socket"
fi
url="--url $1"
token="--token $2"
[ ! -z "$3" ] && labels="--labels $3"
for key in /opt/keys/gpg/*; do
gpg --import $key
done
cat /opt/signing_keys.txt | while read key; do
gpg --recv-keys $key;
done
mkdir -p config
sudo chown runner:runner persistent
if [ -f persistent/runner ]; then
cp persistent/runner .runner
cp persistent/credentials .credentials
cp persistent/credentials_rsaparams .credentials_rsaparams
else
# Note: this passes both the option and the value, quoting the following
# variables would result in INVALID BEHAVIOR, do NOT quote the variables.
./config.sh $url $token $labels --unattended --disableupdate
cp .runner persistent/runner
cp .credentials persistent/credentials
cp .credentials_rsaparams persistent/credentials_rsaparams
fi
./run.sh