forked from bpetit/Stouts.nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
36 lines (36 loc) · 1.4 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
language: python
python:
- "2.7"
- "3.6"
sudo: required
dist: trusty
cache:
directories: [ '$HOME/lxc' ]
pip: true
env:
- ANSIBLE_GIT_VERSION='devel' # 2.6.x development branch
- ANSIBLE_VERSION='<2.6.0' # 2.5.x
matrix:
fast_finish: true
include:
- python: '2.7'
env: ANSIBLE_VERSION='<2.5.0' # 2.4.x
install:
- if [ "$ANSIBLE_GIT_VERSION" ]; then pip install "https://github.com/ansible/ansible/archive/${ANSIBLE_GIT_VERSION}.tar.gz";
else pip install "ansible${ANSIBLE_VERSION}"; fi
- ansible --version
- ansible-galaxy install lae.travis-lxc
- ansible-playbook tests/install.yml -i tests/inventory
- git archive --format tar.gz HEAD > idolactivities.nginx.tar.gz && ansible-galaxy install
idolactivities.nginx.tar.gz,$(git rev-parse HEAD),idolactivities.nginx && rm idolactivities.nginx.tar.gz
before_script: cd tests/
script:
- ansible-playbook -i inventory deploy.yml --syntax-check
- ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -i inventory deploy.yml
- 'ANSIBLE_STDOUT_CALLBACK=debug unbuffer ansible-playbook -vvi inventory
deploy.yml > play.log || (e=$?; cat play.log; exit $e); printf "Idempotence: ";
grep -A1 "PLAY RECAP" play.log | grep -qP "changed=0 .*failed=0 .*"
&& (echo "PASS"; exit 0) || (echo "FAIL"; cat play.log; exit 1)'
- ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -i inventory -v test.yml
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/