ansible-role-nginx/.travis.yml

216 lines
5.6 KiB
YAML
Raw Permalink Normal View History

2018-01-10 23:46:32 +01:00
---
sudo: required
services:
- docker
matrix:
include:
- env:
distribution: centos
version: 6
playbook: basic
- env:
distribution: centos
version: 6
playbook: http-template
- env:
distribution: centos
version: 6
playbook: modules
- env:
distribution: centos
version: 6
playbook: push
- env:
distribution: centos
version: 6
playbook: stable
- env:
distribution: centos
version: 6
playbook: stream-template
- env:
distribution: centos
version: 6
playbook: unit
- env:
distribution: centos
version: 7
playbook: basic
- env:
distribution: centos
version: 7
playbook: http-template
- env:
distribution: centos
version: 7
playbook: modules
- env:
distribution: centos
version: 7
playbook: push
- env:
distribution: centos
version: 7
playbook: stable
- env:
distribution: centos
version: 7
playbook: stream-template
- env:
distribution: centos
version: 7
playbook: unit
- env:
distribution: debian
version: jessie
playbook: basic
- env:
distribution: debian
version: jessie
playbook: http-template
- env:
distribution: debian
version: jessie
playbook: modules
- env:
distribution: debian
version: jessie
playbook: push
- env:
distribution: debian
version: jessie
playbook: stable
- env:
distribution: debian
version: jessie
playbook: stream-template
- env:
distribution: debian
version: jessie
playbook: unit
- env:
distribution: debian
version: stretch
playbook: basic
- env:
distribution: debian
version: stretch
playbook: http-template
- env:
distribution: debian
version: stretch
playbook: modules
- env:
distribution: debian
version: stretch
playbook: push
- env:
distribution: debian
version: stretch
playbook: stable
- env:
distribution: debian
version: stretch
playbook: stream-template
- env:
distribution: debian
version: stretch
playbook: unit
- env:
distribution: ubuntu
version: trusty
playbook: basic
- env:
distribution: ubuntu
version: trusty
playbook: http-template
- env:
distribution: ubuntu
version: trusty
playbook: modules
- env:
distribution: ubuntu
version: trusty
playbook: push
- env:
distribution: ubuntu
version: trusty
playbook: stable
- env:
distribution: ubuntu
version: trusty
playbook: stream-template
- env:
distribution: ubuntu
version: xenial
playbook: basic
- env:
distribution: ubuntu
version: xenial
playbook: http-template
- env:
distribution: ubuntu
version: xenial
playbook: modules
- env:
distribution: ubuntu
version: xenial
playbook: push
- env:
distribution: ubuntu
version: xenial
playbook: stable
- env:
distribution: ubuntu
version: xenial
playbook: stream-template
- env:
distribution: ubuntu
version: xenial
playbook: unit
- env:
distribution: ubuntu
version: bionic
playbook: basic
- env:
distribution: ubuntu
version: bionic
playbook: http-template
- env:
distribution: ubuntu
version: bionic
playbook: modules
- env:
distribution: ubuntu
version: bionic
playbook: push
- env:
distribution: ubuntu
version: bionic
playbook: stable
- env:
distribution: ubuntu
version: bionic
playbook: stream-template
- env:
distribution: ubuntu
version: bionic
playbook: unit
before_install:
- 'sudo docker pull ${distribution}:${version}'
- 'sudo docker build --no-cache --rm --file=tests/dockerfiles/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'
2018-01-10 23:46:32 +01:00
script:
- container_id=$(mktemp)
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/ansible-role-nginx:ro ${distribution}-${version}:ansible > "${container_id}"'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-nginx/tests/playbooks/nginx-${playbook}.yml --syntax-check'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-nginx/tests/playbooks/nginx-${playbook}.yml'
2018-01-10 23:46:32 +01:00
- >
sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-nginx/tests/playbooks/nginx-${playbook}.yml
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- 'if [${playbook} != "unit"]; then sudo docker exec "$(cat ${container_id})" curl http://localhost/; fi'
- 'sudo docker rm -f "$(cat ${container_id})"'
2018-01-10 23:46:32 +01:00
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/