forked from jemalloc/jemalloc-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-bb-worker.sh
More file actions
executable file
·33 lines (25 loc) · 842 Bytes
/
Copy pathsetup-bb-worker.sh
File metadata and controls
executable file
·33 lines (25 loc) · 842 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
#!/usr/bin/env bash
set -e
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && git rev-parse --show-toplevel)
if [[ -z $WORKER_BB_SECRETS_FILE ]]; then
echo "Need WORKER_BB_SECRETS_FILE=[ubuntu|freebsd]_bb_secrets.json defined!"
exit 1
fi
FILENAME="~/secrets/$WORKER_BB_SECRETS_FILE"
BB_UN=`jq --raw-output '.["bb_un"]' ~/secrets/"$WORKER_BB_SECRETS_FILE"`
BB_PW=`jq --raw-output '.["bb_pw"]' ~/secrets/"$WORKER_BB_SECRETS_FILE"`
MASTER_HOST=`jq --raw-output '.["master_host"]' ~/secrets/public.json`
if [[ -z $MASTER_HOST || -z $BB_UN || -z $BB_PW ]]; then
echo "Trouble obtaining secrets"
exit 1
fi
cd
if [[ -e bb-dir ]]; then
rm -r bb-dir
fi
mkdir bb-dir
cd bb-dir
virtualenv --no-site-packages sandbox
source sandbox/bin/activate
pip install buildbot-worker
buildbot-worker create-worker worker $MASTER_HOST $BB_UN $BB_PW