blob: 4e1a6cd95501198b448e02069d12ad9f78b275cf (
plain)
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
|
#!/usr/bin/env bash
# Build the worker image and run it on this host.
set -euo pipefail
HERE=$(cd "$(dirname "$0")" && pwd)
if [ ! -f /root/buildbot/secrets/worker_pass ]; then
mkdir -p /root/buildbot/secrets
openssl rand -hex 12 > /root/buildbot/secrets/worker_pass
chmod 600 /root/buildbot/secrets/worker_pass
fi
docker build -t kukuri-worker:latest -f "$HERE/Dockerfile.worker" "$HERE"
docker rm -f kukuri-worker 2>/dev/null || true
docker run -d --name kukuri-worker --restart unless-stopped \
-e MASTER=192.168.3.110:9989 \
-v jenkins-data:/var/jenkins_home \
-v /root/buildbot/secrets/worker_pass:/run/secrets/worker_pass:ro \
-v /root/buildbot/secrets/git_pass:/run/secrets/git_pass:ro \
-v /root/buildbot/secrets/github_token:/run/secrets/github_token:ro \
kukuri-worker:latest
sleep 5
docker logs --tail 10 kukuri-worker
echo "Worker is retrying toward MASTER (will connect once master is up on 192.168.3.110:9989)"
|