-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathstart.sh
More file actions
28 lines (21 loc) · 821 Bytes
/
start.sh
File metadata and controls
28 lines (21 loc) · 821 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
trap cleanup 1 2 3 6
cleanup() {
gitlab-runner unregister --all-runners
sleep 5
}
if [[ "$TLS_CA_CERT" ]]; then
mkdir -p "$HOME"/.gitlab-runner/certs/
echo "$TLS_CA_CERT" > "$HOME"/.gitlab-runner/certs/$(echo "$CI_SERVER_URL" | cut -d'/' -f3 | cut -d':' -f1).crt
fi
echo "$PRIVATE_KEY" > "$HOME"/priv_key
gitlab-runner register --non-interactive \
--executor=custom \
--custom-config-exec="$HOME"/config.sh \
--custom-prepare-exec="$HOME"/prepare.py \
--custom-run-exec="$HOME"/run.py \
--custom-cleanup-exec="$HOME"/cleanup.py
if [[ "$CONCURRENT" ]]; then
sed -i "s/concurrent = .*/concurrent = $CONCURRENT/g" "$HOME"/.gitlab-runner/config.toml
fi
gitlab-runner run