~timkuhlman/mojo/lxd-fixes

« back to all changes in this revision

Viewing changes to contrib/LXD/container/build_mojo_lxd.sh

  • Committer: Tim Kuhlman
  • Date: 2016-11-28 18:33:21 UTC
  • Revision ID: timothy.kuhlman@canonical.com-20161128183321-uot86r14ce0agdz0
Initial move to updated test scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
#
3
 
# Build a mojo image for development and testing of mojo (https://mojo.canonical.com)
4
 
#
5
 
 
6
 
#Launch the container
7
 
#name=mojo-$(date +%Y-%m-%d)  # Useful if you are testing multiple versions.
8
 
name=mojo
9
 
 
10
 
lxc launch ubuntu:16.04 $name -c security.nesting=true
11
 
sleep 15  # Takes a moment for the network
12
 
 
13
 
# Pre-req install
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
17
 
 
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
22
 
 
23
 
# Setup bzr identity for some of the mojo tests
24
 
lxc exec $name -- su ubuntu -c 'bzr whoami "test <integration@test.com>"'
25
 
 
26
 
# Setup test scripts
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
30
 
done
31
 
 
32
 
# Setup spec envrc
33
 
for envrc in $(ls *.envrc); do
34
 
  lxc file push ./$envrc $name/home/ubuntu/$envrc
35
 
done
36
 
 
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"