-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
43 lines (34 loc) · 1.04 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
---
language: python
python: "2.7"
before_install:
- sudo apt-get update -qq
# Remove PHP
- sudo apt-get remove --purge 'php*'
- sudo apt-get autoremove
- sudo apt-get autoclean
# Remove WP CLI
- sudo rm -f /usr/bin/wp
install:
# Install Ansible
- pip install ansible
- sudo apt-get install php5-cli
# Add ansible.cfg to pick up roles path.
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
script:
# Check test playbook syntax
- "ansible-playbook -i tests/inventory tests/playbook.yml --syntax-check"
# Run the test playbook
- "ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo"
# Run the test playbook again to test it idempotent
- >
ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# Test Composer is installed
- >
wp cli version
| grep -q 'WP-CLI'
&& (echo 'WP-CLI install successful' && exit 0)
|| (echo 'WP-CLI install failed' && exit 1)