Skip to content
This repository was archived by the owner on Mar 20, 2021. It is now read-only.

Commit 2a9f099

Browse files
committed
added travis file
1 parent d458627 commit 2a9f099

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.travis.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
language: python
2+
3+
python:
4+
- 2.7
5+
6+
sudo: required
7+
8+
env:
9+
- ANSIBLE_VERSION=latest
10+
- ANSIBLE_VERSION=2.1
11+
12+
branches:
13+
only:
14+
- master
15+
16+
install:
17+
# Install Ansible.
18+
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi
19+
20+
# Add ansible.cfg to pick up roles path.
21+
- printf "[defaults]\nroles_path = ../" > ansible.cfg
22+
23+
script:
24+
# Check the role/playbook's syntax.
25+
- ansible-playbook -i tests/inventory tests/test.yml --syntax-check
26+
27+
# Run the role/playbook with ansible-playbook.
28+
- ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo -vvvv
29+
30+
# Run the role/playbook again, checking to make sure it's idempotent.
31+
- >
32+
ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo
33+
| grep -q 'changed=0.*failed=0'
34+
&& (echo 'Idempotence test: pass' && exit 0)
35+
|| (echo 'Idempotence test: fail' && exit 1)
36+
37+
matrix:
38+
fast_finish: true
39+
40+
notifications:
41+
email: false
42+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

0 commit comments

Comments
 (0)