3 # This script will create xenial and trusty lxd images that will be used by the
4 # lxd provider in juju 2.1+ It is for use with the lxd provider for local
5 # development and preinstalls a common set of production packages.
7 # This dramatically speeds up the install hooks for lxd deploys by
8 # pre-installing common packages. It is intended to run daily as part of
12 # The basic charm layer also installs all the things. 47 packages.
13 LAYER_BASIC
="gcc build-essential python3-pip python3-setuptools python3-yaml"
15 # the basic layer also installs virtualenv, but the name changed in xenial.
16 TRUSTY_PACKAGES
="python-virtualenv"
17 XENIAL_PACKAGES
="virtualenv"
19 # Predownload common packages used by your charms in development
22 PACKAGES
="$LAYER_BASIC $DOWNLOAD_PACKAGES"
26 container
=juju-
${series}-base
27 alias=juju
/$series/amd64
29 lxc delete
$container -f || true
30 lxc launch ubuntu
:$series $container
31 sleep 5 # wait for network
33 lxc
exec $container -- apt-get update
-y
34 lxc
exec $container -- apt-get upgrade
-y
35 lxc
exec $container -- apt-get
install -y $PACKAGES $2
38 lxc image delete
$alias || true
39 lxc publish
$container --alias $alias description
="$series juju dev image ($(date +%Y%m%d))"
41 lxc delete
$container -f || true
44 cache trusty
"$TRUSTY_PACKAGES"
45 cache xenial
"$XENIAL_PACKAGES"