-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
50 lines (48 loc) · 2.29 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
language: python
sudo: required
dist: trusty
cache:
directories: [ '$HOME/lxc' ]
pip: true
env:
global:
- fast_finish: true
- MAKEFLAGS="-j 2"
matrix:
- LXC_DISTRO=debian LXC_RELEASE=stretch
- LXC_DISTRO=debian LXC_RELEASE=jessie
- LXC_DISTRO=debian LXC_RELEASE=wheezy
- LXC_DISTRO=ubuntu LXC_RELEASE=xenial
- LXC_DISTRO=ubuntu LXC_RELEASE=trusty
- LXC_DISTRO=ubuntu LXC_RELEASE=precise
- LXC_DISTRO=centos LXC_RELEASE=7
- LXC_DISTRO=ubuntu LXC_RELEASE=xenial ANSIBLE_VERSION='ansible>=2.2.0,<2.3.0' #2.2.x security only
- LXC_DISTRO=ubuntu LXC_RELEASE=xenial ANSIBLE_VERSION='ansible>=2.3.0,<2.4.0' #2.3.x bugs and security
- LXC_DISTRO=ubuntu LXC_RELEASE=xenial ANSIBLE_VERSION='ansible>=2.4.0,<2.5.0' #2.4.x bugs and security
- LXC_DISTRO=ubuntu LXC_RELEASE=xenial ANSIBLE_VERSION='git+https://github.com/ansible/ansible.git@devel' #2.5 DEVEL
- LXC_DISTRO=ubuntu LXC_RELEASE=xenial ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3' #Python3
matrix:
allow_failures:
- env: LXC_DISTRO=ubuntu LXC_RELEASE=xenial ANSIBLE_VERSION='git+https://github.com/ansible/ansible.git@devel' #2.5 DEVEL
- env: LXC_DISTRO=ubuntu LXC_RELEASE=xenial ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3' #Python3
before_cache:
- sudo mkdir $HOME/lxc && sudo tar cf $HOME/lxc/cache.tar /var/cache/lxc/ && sudo chown $USER. $HOME/lxc/cache.tar
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y expect-dev
install:
- sudo tar xf $HOME/lxc/cache.tar -C / || true
- if [ "$ANSIBLE_VERSION" ]; then pip install $ANSIBLE_VERSION; else pip install ansible; fi
- ansible --version
- printf '[defaults]\nroles_path=../\ncallback_whitelist=profile_tasks' >ansible.cfg
before_script:
- ansible-galaxy install lae.travis-lxc
- ansible-playbook -vv tests/install.yml -i 'localhost,'
script:
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
- ansible-playbook -vv tests/test.yml -i tests/inventory
- unbuffer ansible-playbook tests/test.yml -i tests/inventory >/tmp/idempotency.log 2>&1
- 'grep -A1 "PLAY RECAP" /tmp/idempotency.log | grep -qP "changed=0.*failed=0" &&
(echo "Idempotence PASS"; exit 0) || (echo "Idempotence FAIL"; cat /tmp/idempotency.log; exit 1)'
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/