3
# Build a mojo image for development and testing of mojo (https://mojo.canonical.com)
7
#name=mojo-$(date +%Y-%m-%d) # Useful if you are testing multiple versions.
10
lxc launch ubuntu:16.04 $name -c security.nesting=true
11
sleep 15 # Takes a moment for the network
14
lxc exec $name -- apt-get update
15
lxc exec $name -- apt-get install -y software-properties-common
16
lxc exec $name -- apt-add-repository -y ppa:mojo-maintainers/ppa
18
lxc exec $name -- apt-get update
19
lxc exec $name -- apt-get dist-upgrade -y
20
# python swiftclient is needed for the mojo-how-to spec most others are build/test deps
21
lxc exec $name -- apt-get install -y mojo bzr juju devscripts debhelper python-all python-setuptools python-swiftclient python-nose python-coverage python-mock python-argcomplete python-juju-deployer
23
# Setup bzr identity for some of the mojo tests
24
lxc exec $name -- su ubuntu -c 'bzr whoami "test <integration@test.com>"'
27
for s in "install-from-branch.sh" "run-mojo-spec.sh"; do
28
lxc file push ./$s $name/home/ubuntu/$s
29
lxc exec $name -- chmod +x /home/ubuntu/$s
33
for envrc in $(ls *.envrc); do
34
lxc file push ./$envrc $name/home/ubuntu/$envrc
37
echo "Now run a shell with 'lxc exec $name -- su - ubuntu'"
38
echo "Then you can branch mojo install it and run integration tests, or branch a new spec to test."
39
echo "Refer to README.md in the container for more information"