-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
executable file
·25 lines (20 loc) · 1 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
---
sudo: required
services:
- docker
env:
- distribution: ubuntu
version: bionic
before_install:
- 'sudo docker pull wyhasany/${distribution}-ansible:${version}'
script:
- container_id=$(mktemp)
- 'sudo docker run --detach --privileged --volume="${PWD}":/etc/ansible/roles/nginx_role wyhasany/${distribution}-ansible:${version} > "${container_id}"'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook /etc/ansible/roles/nginx_role/travis/test.yml --syntax-check'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook /etc/ansible/roles/nginx_role/travis/test.yml --skip-tags "no-tests"'
- >
sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook /etc/ansible/roles/nginx_role/travis/test.yml --skip-tags "no-tests"
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- 'sudo docker rm -f "$(cat ${container_id})"'