blob: 7e2234ace7c73df5a4e9431e9c962e14917f05fa [file] [log] [blame]
peusterm86fc48e2017-02-06 08:48:56 +01001#!/bin/bash
peustermd7cbd212017-09-07 08:55:14 +02002# Copyright (c) 2015 SONATA-NFV and Paderborn University
3# ALL RIGHTS RESERVED.
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
peusterm86fc48e2017-02-06 08:48:56 +01008#
peustermd7cbd212017-09-07 08:55:14 +02009# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# Neither the name of the SONATA-NFV, Paderborn University
18# nor the names of its contributors may be used to endorse or promote
19# products derived from this software without specific prior written
20# permission.
21#
22# This work has been performed in the framework of the SONATA project,
23# funded by the European Commission under Grant number 671517 through
24# the Horizon 2020 and 5G-PPP programmes. The authors would like to
25# acknowledge the contributions of their colleagues of the SONATA
26# partner consortium (www.sonata-nfv.eu).
27#
peusterm86fc48e2017-02-06 08:48:56 +010028# This is the entry point for Jenkins.
29# Script has do be called from "son-emu" root directory, like: sudo ./utils/ci/jenkins_entrypoint.sh
30export DOCKER_HOST="unix:///var/run/docker.sock"
31
peusterm7e8aa5e2017-02-06 09:09:26 +010032# don't rely on Debian/Ubuntu Docker engine
peusterm8046dfe2017-02-06 09:10:54 +010033apt-get remove docker-engine
peusterm2f3ad5e2017-02-06 12:54:26 +010034# make sure we start from scratch
35pip uninstall docker-py
36pip uninstall docker
peusterm7e8aa5e2017-02-06 09:09:26 +010037
peusterm86fc48e2017-02-06 08:48:56 +010038set -e
39set -x
40
41SON_EMU_DIR=$(pwd)
42cd $SON_EMU_DIR/../
43
44# prepare
45apt-get update
peusterm04142612017-02-06 08:54:18 +010046DEBIAN_FRONTEND=noninteractive apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y git ansible aptitude
peusterm86fc48e2017-02-06 08:48:56 +010047echo "localhost ansible_connection=local" >> /etc/ansible/hosts
48
49# install containernet
50git clone https://github.com/containernet/containernet.git
51CONTAINERNET_DIR=$(pwd)/containernet
52echo "Installing containernet (will take some time ~30 minutes) ..."
53cd $CONTAINERNET_DIR/ansible
54ansible-playbook install.yml
55
56# install son-emu
57echo "Installing son-emu (will take some time) ..."
58cd $SON_EMU_DIR/ansible
59ansible-playbook install.yml
60
61# execute son-emu tests at the end to validate installation
62echo "Running son-emu unit tests to validate installation"
63cd $SON_EMU_DIR
64python setup.py develop
peusterm3d153942017-02-08 08:23:33 +010065
peusterm2ed4ae42017-09-07 08:19:29 +020066# run the unit tests
67py.test -v src/emuvim/test/unittests
peusterm86fc48e2017-02-06 08:48:56 +010068
69