Merge pull request #196 from mpeuster/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 # make sure we start from scratch
10 pip uninstall docker-py
11 pip uninstall docker
12
13 set -e
14 set -x
15
16 SON_EMU_DIR=$(pwd)
17 cd $SON_EMU_DIR/../
18
19 # prepare
20 apt-get update
21 DEBIAN_FRONTEND=noninteractive apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y git ansible aptitude
22 echo "localhost ansible_connection=local" >> /etc/ansible/hosts
23
24 # install containernet
25 git clone https://github.com/containernet/containernet.git
26 CONTAINERNET_DIR=$(pwd)/containernet
27 echo "Installing containernet (will take some time ~30 minutes) ..."
28 cd $CONTAINERNET_DIR/ansible
29 ansible-playbook install.yml
30
31 # install son-emu
32 echo "Installing son-emu (will take some time) ..."
33 cd $SON_EMU_DIR/ansible
34 ansible-playbook install.yml
35
36 # execute son-emu tests at the end to validate installation
37 echo "Running son-emu unit tests to validate installation"
38 cd $SON_EMU_DIR
39 python setup.py develop
40
41
42
43