-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (34 loc) · 960 Bytes
/
.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
---
sudo: required
language: generic
before_install:
# Install pip
- sudo easy_install pip
- sudo pip install ansible
- sudo pip install ansible-lint
- sudo pip install yamllint
install:
# Check versions
- python --version
- ansible --version
- ansible-lint --version
- yamllint --version
script:
# Lint all YAML files.
- yamllint .
# Check the role/playbook's syntax.
- ansible-playbook tests/playbook.yml --syntax-check
# Lint the playbook.
- ansible-lint tests/playbook.yml
# Test the playbook.
- ansible-playbook tests/playbook.yml
# Test the playbook's idempotence.
- idempotence=$(mktemp)
- ansible-playbook tests/playbook.yml | tee -a ${idempotence}
- >-
tail -25 ${idempotence} |
grep -q 'changed=0.*failed=0' &&
(echo 'Idempotence test: pass' && exit 0) ||
(echo 'Idempotence test: fail' && exit 1)
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/