~abentley/juju-ci-tools/client-from-config-4

« back to all changes in this revision

Viewing changes to update-jenkins-branches.bash

  • Committer: Aaron Bentley
  • Date: 2016-03-18 14:47:06 UTC
  • mto: This revision was merged to the branch mainline in revision 1324.
  • Revision ID: aaron.bentley@canonical.com-20160318144706-z7wy9c21m3psi6g5
Introduce set_model_name, update tests, check controller on bootstrap.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# the --cloud-city option will also update credential and configs.
4
4
set -eux
5
5
 
6
 
HERE=$(pwd)
7
6
SCRIPTS=$(readlink -f $(dirname $0))
8
 
REPOSITORY_PARENT=$(dirname $SCRIPTS)
 
7
REPOSITORY=${JUJU_REPOSITORY:-$(dirname $SCRIPTS)/repository}
9
8
 
10
9
MASTER="juju-ci.vapour.ws"
11
10
SLAVES="precise-slave.vapour.ws trusty-slave.vapour.ws \
12
11
    wily-slave.vapour.ws xenial-slave.vapour.ws \
13
 
    ppc64el-slave.vapour.ws arm64-slave.vapour.ws \
14
 
    kvm-slave.vapour.ws \
 
12
    ppc64el-slave.vapour.ws i386-slave.vapour.ws arm64-slave.vapour.ws \
 
13
    kvm-slave.vapour.ws jujuqa-stack-slave.internal \
15
14
    munna-maas-slave.vapour.ws  silcoon-maas-slave.vapour.ws \
16
15
    canonistack-slave.vapour.ws juju-core-slave.vapour.ws \
17
16
    cloud-health-slave.vapour.ws certification-slave.vapour.ws \
18
 
    charm-bundle-slave.vapour.ws osx-slave.vapour.ws \
19
 
    s390x-slave.vapour.ws feature-slave.vapour.ws release-slave.vapour.ws"
 
17
    charm-bundle-slave.vapour.ws osx-slave.vapour.ws"
20
18
WIN_SLAVES="win-slave.vapour.ws"
21
19
KEY="staging-juju-rsa"
22
20
export JUJU_ENV="juju-ci3"
63
61
if [[ \$(uname) == "Linux" ]]; then
64
62
    cd ~/juju-ci-tools
65
63
    make install-deps
66
 
    # The lsb_release package is broken in xenial and yakkety. The py2 module
67
 
    # is missing.
68
 
    if  [[ ! -f /usr/lib/python2.7/dist-packages/lsb_release.py ]]; then
69
 
            sudo cp /usr/lib/python3/dist-packages/lsb_release.py \
70
 
                    /usr/lib/python2.7/dist-packages/lsb_release.py
71
 
    fi
72
 
elif [[ \$(uname) == "Darwin" ]]; then
73
 
    ~/juju-ci-tools/pipdeps.py install
74
64
fi
75
65
if [[ -d ~/ci-director ]]; then
76
66
    bzr pull -d ~/ci-director
79
69
}
80
70
 
81
71
 
82
 
update_windows() {
83
 
    hostname=$1
84
 
    scp repository.zip Administrator@$hostname:/cygdrive/c/Users/Administrator/
85
 
    ssh Administrator@$hostname << EOT
86
 
bzr pull -d ./juju-release-tools
87
 
bzr pull -d ./juju-ci-tools
88
 
/cygdrive/c/progra~2/7-Zip/7z.exe x -y repository.zip
89
 
python ./juju-ci-tools/pipdeps.py install
90
 
EOT
91
 
}
92
 
 
93
 
 
94
72
CLOUD_CITY="false"
95
73
while [[ "${1-}" != "" ]]; do
96
74
    case $1 in
102
80
done
103
81
 
104
82
SKIPPED=""
105
 
for hostname in $MASTER $SLAVES; do
106
 
    update_jenkins $hostname || SKIPPED="$SKIPPED $hostname"
 
83
for host in $MASTER $SLAVES; do
 
84
    update_jenkins $host || SKIPPED="$SKIPPED $host"
107
85
done
108
 
 
109
86
# win-slaves have a different user and directory layout tan POSIX hosts.
110
 
# Also, win+bzr does not support symlinks, so we zip the local charm repo.
111
 
(cd $REPOSITORY_PARENT; zip -q -r $HERE/repository.zip repository -x *.bzr*)
112
 
for hostname in $WIN_SLAVES; do
113
 
    update_windows $hostname || update_windows $hostname
114
 
    if [[ $? -ne 0  ]]; then
115
 
        SKIPPED="$SKIPPED $hostname"
116
 
    fi
 
87
for host in $WIN_SLAVES; do
 
88
    zip -q -r repository.zip $REPOSITORY -x *.bzr*
 
89
    scp repository.zip Administrator@$host:/cygdrive/c/Users/Administrator/
 
90
    ssh Administrator@$host << EOT
 
91
bzr pull -d ./juju-release-tools
 
92
bzr pull -d ./juju-ci-tools
 
93
/cygdrive/c/progra~2/7-Zip/7z.exe x -y repository.zip
 
94
EOT
117
95
done
118
96
 
119
97
if [[ -n "$SKIPPED" ]]; then
121
99
    echo
122
100
    echo "These hosts were skipped because there was an error"
123
101
    echo "$SKIPPED"
124
 
    exit 1
125
102
fi
126
 
echo "All hosts updated."
127
103