| peusterm | 86fc48e | 2017-02-06 08:48:56 +0100 | [diff] [blame] | 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 | |
| peusterm | 7e8aa5e | 2017-02-06 09:09:26 +0100 | [diff] [blame] | 7 | # don't rely on Debian/Ubuntu Docker engine |
| peusterm | 8046dfe | 2017-02-06 09:10:54 +0100 | [diff] [blame] | 8 | apt-get remove docker-engine |
| peusterm | 2f3ad5e | 2017-02-06 12:54:26 +0100 | [diff] [blame] | 9 | # make sure we start from scratch |
| 10 | pip uninstall docker-py |
| 11 | pip uninstall docker |
| peusterm | 7e8aa5e | 2017-02-06 09:09:26 +0100 | [diff] [blame] | 12 | |
| peusterm | 86fc48e | 2017-02-06 08:48:56 +0100 | [diff] [blame] | 13 | set -e |
| 14 | set -x |
| 15 | |
| 16 | SON_EMU_DIR=$(pwd) |
| 17 | cd $SON_EMU_DIR/../ |
| 18 | |
| 19 | # prepare |
| 20 | apt-get update |
| peusterm | 0414261 | 2017-02-06 08:54:18 +0100 | [diff] [blame] | 21 | DEBIAN_FRONTEND=noninteractive apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y git ansible aptitude |
| peusterm | 86fc48e | 2017-02-06 08:48:56 +0100 | [diff] [blame] | 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 |
| peusterm | 3d15394 | 2017-02-08 08:23:33 +0100 | [diff] [blame] | 40 | |
| peusterm | 86fc48e | 2017-02-06 08:48:56 +0100 | [diff] [blame] | 41 | |
| 42 | |
| 43 | |