2
# Update the required resources on the Jenkins master and slaves.
3
# the --cloud-city option will also update credential and configs.
2
# As a member of juju-qa, Visit each the jenkins master and slaves
3
# and update their branches.
4
# passing 'true' as an arg will driect the script to try to update cloud-city.
7
SCRIPTS=$(readlink -f $(dirname $0))
8
REPOSITORY_PARENT=$(dirname $SCRIPTS)
10
7
MASTER="juju-ci.vapour.ws"
11
8
SLAVES="precise-slave.vapour.ws trusty-slave.vapour.ws \
12
xenial-slave.vapour.ws yakkety-slave.vapour.ws \
13
ppc64el-slave.vapour.ws ppc64-slave.vapour.ws \
14
arm64-slave.vapour.ws s390x-slave.vapour.ws \
15
kvm-slave.vapour.ws certification-slave.vapour.ws \
16
munna-maas-slave.vapour.ws silcoon-maas-slave.vapour.ws \
17
canonistack-slave.vapour.ws osx-slave.vapour.ws \
18
release-slave.vapour.ws cloud-health-slave.vapour.ws \
19
juju-core-slave.vapour.ws charm-bundle-slave.vapour.ws \
20
feature-slave.vapour.ws \
21
lxd-slave-a.vapour.ws lxd-slave-b.vapour.ws \
22
juju-core-slave-b.vapour.ws"
23
WIN_SLAVES="win-slave.vapour.ws"
9
utopic-slave-a.vapour.ws utopic-slave-b.vapour.ws \
10
vivid-slave.vapour.ws vivid-slave-b.vapour.ws \
11
ppc64el-slave.vapour.ws i386-slave.vapour.ws kvm-slave.vapour.ws \
12
canonistack-slave.vapour.ws juju-core-slave.vapour.ws \
13
charm-bundle-slave.vapour.ws osx-slave.vapour.ws"
24
14
KEY="staging-juju-rsa"
25
15
export JUJU_ENV="juju-ci3"
30
20
if [[ $hostname == $MASTER ]]; then
31
21
# Bypass DNS which points to the apache front-end.
32
22
host="54.86.142.177"
33
elif [[ $hostname =~ .*[.]internal$ ]]; then
34
host=$hostname # resolved by /etc/hosts
36
24
host=$(host -4 -t A $hostname 8.8.8.8 | tail -1 | cut -d ' ' -f4)
48
36
(cd ~/cloud-city; bzr revert; cd -)
49
37
bzr pull -d ~/cloud-city ~/cloud-city.new
50
38
rm -r ~/cloud-city.new
51
sudo chown -R jenkins ~/cloud-city
52
chmod -R go-w ~/cloud-city
53
chmod 700 ~/cloud-city
54
chmod 700 ~/cloud-city/gnupg
55
chmod 600 ~/cloud-city/staging-juju-rsa
58
bzr pull -d ~/juju-release-tools
59
bzr pull -d ~/repository
60
bzr pull -d ~/juju-ci-tools
61
if [[ ! -e ~/workspace-runner ]]; then
62
bzr branch http://bazaar.launchpad.net/~juju-qa/workspace-runner/trunk/\
65
bzr pull -d ~/workspace-runner
40
cd ~/juju-release-tools
66
46
if [[ \$(uname) == "Linux" ]]; then
69
# The lsb_release package is broken in xenial and yakkety. The py2 module
71
if [[ ! -f /usr/lib/python2.7/dist-packages/lsb_release.py ]]; then
72
sudo cp /usr/lib/python3/dist-packages/lsb_release.py \
73
/usr/lib/python2.7/dist-packages/lsb_release.py
75
elif [[ \$(uname) == "Darwin" ]]; then
76
~/juju-ci-tools/pipdeps.py install
78
49
if [[ -d ~/ci-director ]]; then
79
bzr pull -d ~/ci-director
87
scp repository.zip Administrator@$hostname:/cygdrive/c/Users/Administrator/
88
ssh Administrator@$hostname << EOT
89
bzr pull -d ./juju-release-tools
90
bzr pull -d ./juju-ci-tools
91
/cygdrive/c/progra~2/7-Zip/7z.exe x -y repository.zip
92
python ./juju-ci-tools/pipdeps.py install
98
58
while [[ "${1-}" != "" ]]; do
108
for hostname in $MASTER $SLAVES; do
109
update_jenkins $hostname || SKIPPED="$SKIPPED $hostname"
112
# win-slaves have a different user and directory layout tan POSIX hosts.
113
# Also, win+bzr does not support symlinks, so we zip the local charm repo.
114
(cd $REPOSITORY_PARENT; zip -q -r $HERE/repository.zip repository -x *.bzr*)
115
for hostname in $WIN_SLAVES; do
116
update_windows $hostname || update_windows $hostname
117
if [[ $? -ne 0 ]]; then
118
SKIPPED="$SKIPPED $hostname"
68
for host in $MASTER $SLAVES; do
69
update_jenkins $host || SKIPPED="$SKIPPED $host"
122
72
if [[ -n "$SKIPPED" ]]; then