-
Notifications
You must be signed in to change notification settings - Fork 714
/
Copy pathsetup.sh
executable file
·37 lines (30 loc) · 971 Bytes
/
setup.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
36
37
#!/bin/bash
set -e # NB don't set -u, as weave's config.sh doesn't like that.
# shellcheck disable=SC1091
. ./config.sh
echo Copying scope images and scripts to hosts
# shellcheck disable=SC2153
for HOST in $HOSTS; do
SIZE=$(stat --printf="%s" ../scope.tar)
pv -N "scope.tar" -s "$SIZE" ../scope.tar | $SSH -C "$HOST" sudo docker load
done
setup_host() {
local HOST=$1
echo Installing weave on "$HOST"
# Download the latest released weave script locally,
# for use by weave_on
curl -sL git.io/weave -o ./weave
chmod a+x ./weave
run_on "$HOST" "sudo curl -sL git.io/weave -o /usr/local/bin/weave"
run_on "$HOST" "sudo chmod a+x /usr/local/bin/weave"
weave_on "$HOST" setup
echo Prefetching Images on "$HOST"
docker_on "$HOST" pull peterbourgon/tns-db
docker_on "$HOST" pull alpine
docker_on "$HOST" pull busybox
docker_on "$HOST" pull nginx
}
for HOST in $HOSTS; do
setup_host "$HOST" &
done
wait