3a66e10a17
* Add Stream template defaults * Add stream default config template * Added stream template variables * Changed Ansible task to use new stream template
244 lines
6.2 KiB
YAML
244 lines
6.2 KiB
YAML
---
|
|
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: artful
|
|
playbook: basic
|
|
- env:
|
|
distribution: ubuntu
|
|
version: artful
|
|
playbook: http-template
|
|
- env:
|
|
distribution: ubuntu
|
|
version: artful
|
|
playbook: modules
|
|
- env:
|
|
distribution: ubuntu
|
|
version: artful
|
|
playbook: push
|
|
- env:
|
|
distribution: ubuntu
|
|
version: artful
|
|
playbook: stable
|
|
- env:
|
|
distribution: ubuntu
|
|
version: artful
|
|
playbook: stream-template
|
|
- env:
|
|
distribution: ubuntu
|
|
version: artful
|
|
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'
|
|
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'
|
|
- >
|
|
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})"'
|
|
notifications:
|
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|