forked from tzermias/ansible-plesk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
35 lines (29 loc) · 1.13 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
---
language: python
python: "2.7"
env:
- PLESK_VERSION=PLESK_12_5_30
- PLESK_VERSION=PLESK_12_0_18
- PLESK_VERSION=PLESK_11_5_30
before_install:
- sudo apt-get update -qq
install:
- pip install ansible
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
- ansible -i tests/inventory --connection=local localhost -m setup
script:
# Syntax checking
- "ansible-playbook -i tests/inventory tests/test.yml --syntax-check"
# Run playbook
- "travis_wait ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo \
--extra-vars=\"plesk_release_id=$PLESK_VERSION\""
# Run playbook again for idempotency.
# Source: https://servercheck.in/blog/testing-ansible-roles-travis-ci-github
- "travis_wait ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo \
--extra-vars=\"plesk_release_id=$PLESK_VERSION\" "
#| grep -q 'changed=0.*failed=0' \
# && (echo 'Idempotence test: pass' && exit 0) \
# || (echo 'Idempotence test: fail' && exit 1)"
# Check whether Plesk has actually been installed
- "cat /usr/local/psa/version"
# vi: ts=2 sts=2 et sw=2 tw=80