Merge remote-tracking branch 'steven/master'
[osm/vim-emu.git] / utils / ci / jenkins_entrypoint.sh
1 #!/bin/bash
2 #
3 # This is the entry point for Jenkins.
4 # Script has do be called from "son-emu" root directory, like: sudo ./utils/ci/jenkins_entrypoint.sh
5 export DOCKER_HOST="unix:///var/run/docker.sock"
6
7 # don't rely on Debian/Ubuntu Docker engine
8 apt-get remove docker-engine
9
10 set -e
11 set -x
12
13 SON_EMU_DIR=$(pwd)
14 cd $SON_EMU_DIR/../
15
16 # prepare
17 apt-get update
18 DEBIAN_FRONTEND=noninteractive apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y git ansible aptitude
19 echo "localhost ansible_connection=local" >> /etc/ansible/hosts
20
21 # install containernet
22 git clone https://github.com/containernet/containernet.git
23 CONTAINERNET_DIR=$(pwd)/containernet
24 echo "Installing containernet (will take some time ~30 minutes) ..."
25 cd $CONTAINERNET_DIR/ansible
26 ansible-playbook install.yml
27
28 # install son-emu
29 echo "Installing son-emu (will take some time) ..."
30 cd $SON_EMU_DIR/ansible
31 ansible-playbook install.yml
32
33 # execute son-emu tests at the end to validate installation
34 echo "Running son-emu unit tests to validate installation"
35 cd $SON_EMU_DIR
36 python setup.py develop
37 py.test -v src/emuvim/test/unittests
38
39
40