~veebers/juju-ci-tools/model_migration_check_all_units_of_charm

1711.1.1 by Curtis Hovey
Added script to update any windows slave.
1
#!/bin/bash
2
# Update a windows slave
3
set -eux
4
5
HERE=$(pwd)
6
SCRIPTS=$(readlink -f $(dirname $0))
7
REPOSITORY_PARENT=$(dirname $SCRIPTS)
8
9
USER_AT_HOST=$1
10
11
12
update_windows() {
13
    user_at_host=$1
14
    scp repository.zip $user_at_host:/cygdrive/c/Users/Administrator/
15
    ssh $user_at_host << EOT
16
bzr pull -d ./juju-release-tools
17
bzr pull -d ./juju-ci-tools
18
/cygdrive/c/progra~2/7-Zip/7z.exe x -y repository.zip
19
python ./juju-ci-tools/pipdeps.py install
20
EOT
21
}
22
23
24
# win-slaves have a different user and directory layout than POSIX hosts.
25
# Also, win+bzr does not support symlinks, so we zip the local charm repo.
26
(cd $REPOSITORY_PARENT; zip -q -r $HERE/repository.zip repository -x *.bzr*)
27
# The ssh connection to the host is unreliable so it is tried twice.
28
update_windows $USER_AT_HOST || update_windows $USER_AT_HOST