X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2FVCA%2Fupdate-lxd-image.sh;h=07ba90b02b790d6764564b84a2205b3a00bcb808;hb=901a4bfb2449c1badefa86cee714060a60819fc9;hp=ce14b1dc9312303ed5ee600bc610a794c2e1e70e;hpb=828aaf8ed201421d4d3d3fcf74f6764624c365e4;p=osm%2Fdevops.git diff --git a/jenkins/VCA/update-lxd-image.sh b/jenkins/VCA/update-lxd-image.sh index ce14b1dc..07ba90b0 100755 --- a/jenkins/VCA/update-lxd-image.sh +++ b/jenkins/VCA/update-lxd-image.sh @@ -21,6 +21,9 @@ DOWNLOAD_PACKAGES="" PACKAGES="$LAYER_BASIC $DOWNLOAD_PACKAGES" +# Packages from pypi to pre-install +PYPI="charms.reactive charmhelpers paramiko>=1.16.0,<1.17" + function cache() { series=$1 container=juju-${series}-base @@ -28,11 +31,14 @@ function cache() { lxc delete $container -f || true lxc launch ubuntu:$series $container - sleep 5 # wait for network + + # Wait for the container to get an IP address + lxc exec $container -- bash -c "for i in {1..60}; do sleep 1; ping -c1 10.44.127.1 &> /dev/null && break; done" lxc exec $container -- apt-get update -y lxc exec $container -- apt-get upgrade -y lxc exec $container -- apt-get install -y $PACKAGES $2 + lxc exec $container -- pip3 install --upgrade $PYPI lxc stop $container lxc image delete $alias || true