-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
38 lines (30 loc) · 1.07 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
---
language: python
python: "2.7"
env:
- SITE=site.ci.yml
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq python-apt python-pycurl
install:
- pip install ansible==1.6.0
- ansible --version
- pip install https://github.com/willthames/ansible-lint/archive/master.zip
script:
- cd tests
- echo localhost > inventory
# Check the role/playbook's syntax.
- "ansible-playbook -i inventory $SITE --syntax-check"
# Check the role/playbook's lint.
- "ansible-lint $SITE"
# Run the role/playbook with ansible-playbook.
- "ansible-playbook -i inventory $SITE --connection=local --sudo -vv"
# Run the role/playbook again.
- "ansible-playbook -i inventory $SITE --connection=local --sudo -vv | tee idempotent.log"
# Checking to make sure it's idempotent.
- >
grep -q 'changed=0.*failed=0' idempotent.log
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Run Integration Tests role/playbook again.
- "ansible-playbook -i inventory site.integration-tests.yml --connection=local --sudo -vv"