forked from containernet/containernet
-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
executable file
·58 lines (50 loc) · 1.72 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
language: python
sudo: required
matrix:
include:
#- dist: trusty
# python: 2.7
# env: dist="14.04 LTS trusty"
- dist: xenial
python: 2.7
env: dist="16.04 LTS xenial"
- dist: xenial
python: 3.5
env: dist="16.04 LTS xenial"
- dist: bionic
python: 2.7
env: dist="18.04 LTS bionic"
- dist: bionic
python: 3.6
env: dist="18.04 LTS bionic"
env:
global:
- COMMIT=${TRAVIS_COMMIT::8}
virtualenv:
system_site_packages: true
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq vlan
- sudo DEBIAN_FRONTEND=noninteractive apt-get -y install ansible libffi-dev libssl-dev
- cd ansible
# bare metal installation
install:
- travis_wait 60 sudo ansible-playbook -i "localhost," -c local install.yml
before_script:
- cd ..
# run tests
script:
# run unit tests (bare metal)
- sudo py.test -v containernet/test/test_containernet.py
# build ubuntu-based docker container
- travis_wait 60 docker build -t containernet/containernet:ubuntu .
# run unit tests on ubuntu:xenial-based docker container
- docker run --name containernet -i --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock containernet/containernet:ubuntu py.test -v containernet/test/test_containernet.py
# build centos-based docker container
- travis_wait 60 docker build -t containernet/containernet:centos7 -f Dockerfile.centos .
# run unit tests on centos7-based docker container
- docker run --name containernet -i --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock containernet/containernet:centos7 py.test -v containernet/test/test_containernet.py
notifications:
email:
on_success: change
on_failure: always