~gnuoy/ubuntu-openstack-ci/model-config

« back to all changes in this revision

Viewing changes to admin/902-reinstall-juju-all-slaves.sh

Add secgroup cleanup and restrict sudo privileges

Adjust for limited sudo privileges for the jenkins user

Add post-destroy info dump

Remove shim for hashsum mismatch issue in Juju 1.25.6

Bail earlier if mojo operations fail

Update jenkins sudoers

Fixes and workarounds for:
 - https://bugs.launchpad.net/charm-test-infra/+bug/1647000
 - https://github.com/juju/charmstore-client/issues/104
 - https://github.com/juju/docs/issues/1555
 - https://bugs.launchpad.net/bugs/1541482
 - https://bugs.launchpad.net/bugs/1647000
 - https://bugs.launchpad.net/bugs/1646909
 - https://bugs.launchpad.net/bugs/1333162
 - https://bugs.launchpad.net/bugs/1625624
 - https://bugs.launchpad.net/bugs/1570216

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash -ex
 
2
echo $0
 
3
 
 
4
# Purge and reinstall juju and related tools on the master and all jenkins slaves
 
5
apps="osci osci-task osci-lab osci-slave"
 
6
 
 
7
# Optionally inject this to clean up and force reinstall
 
8
#sudo apt-get remove juju juju-core juju-1.25 juju-2.0 juju-local juju-mongodb mojo \
 
9
#    juju-deployer python-jujuclient python-juju-deployer python3-juju-deployer \
 
10
#    amulet python-amulet python3-amulet charm charm-tools \
 
11
#    python-theblues python-libcharmstore python-jujubundlelib -y ||:&&\
 
12
 
 
13
# NOTE: it is necessary to munge symlinks for now, as the 1.25 ppa packaging is
 
14
# actually intended for Trusty (update-alternatives), and otherwise conflicts
 
15
# badly on Xenial.  https://bugs.launchpad.net/bugs/1646909
 
16
 
 
17
cmds="export JUJU_HOME=$HOME/.juju &&\
 
18
sudo apt-get autoremove -y ||:&&\
 
19
sudo add-apt-repository ppa:juju/1.25 -y &&\
 
20
sudo add-apt-repository ppa:juju/1.25-proposed -y &&\
 
21
sudo add-apt-repository ppa:juju/stable -y &&\
 
22
sudo add-apt-repository ppa:juju/proposed -y &&\
 
23
sudo add-apt-repository ppa:mojo-maintainers/ppa -y &&\
 
24
sudo apt-get update -y &&\
 
25
sudo apt-get install juju juju-core mojo charm lxd zfsutils-linux -y &&\
 
26
sudo apt-get install python-juju-deployer python3-juju-deployer &&\  # https://bugs.launchpad.net/bugs/1644922
 
27
sudo usermod -aG mojo jenkins &&\
 
28
sudo ln -fs /usr/lib/juju-1.25.9/bin/juju /usr/bin/juju &&\
 
29
sudo ln -fs /usr/lib/juju-1.25.9/bin/juju /usr/bin/juju-1.25 &&\
 
30
juju version &&\
 
31
juju-1.25 version &&\
 
32
juju-2.0 version &&\
 
33
uname -a"
 
34
 
 
35
for app in $apps; do
 
36
  echo "========== ${app} =========="
 
37
  juju run --service $app "$cmds"
 
38
done
 
39