Cleaning up jenkins test integration.
[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 set -e
8 set -x
9
10 SON_EMU_DIR=$(pwd)
11 cd $SON_EMU_DIR/../
12
13 # prepare
14 apt-get update
15 apt-get install -y git ansible aptitude
16 echo "localhost ansible_connection=local" >> /etc/ansible/hosts
17
18 # install containernet
19 git clone https://github.com/containernet/containernet.git
20 CONTAINERNET_DIR=$(pwd)/containernet
21 echo "Installing containernet (will take some time ~30 minutes) ..."
22 cd $CONTAINERNET_DIR/ansible
23 ansible-playbook install.yml
24
25 # install son-emu
26 echo "Installing son-emu (will take some time) ..."
27 cd $SON_EMU_DIR/ansible
28 ansible-playbook install.yml
29
30 # execute son-emu tests at the end to validate installation
31 echo "Running son-emu unit tests to validate installation"
32 cd $SON_EMU_DIR
33 python setup.py develop
34 py.test -v src/emuvim/test/unittests
35
36
37