blob: a0031243d52ed6b7dedc71edf485175d5c191bfd (
plain) (
tree)
|
|
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: required
services:
- docker
env:
- distribution: centos
init: /usr/lib/systemd/systemd
version: 7
- distribution: fedora
init: /usr/lib/systemd/systemd
version: 29
- distribution: fedora
init: /usr/lib/systemd/systemd
version: 28
- distribution: fedora
init: /usr/lib/systemd/systemd
version: 27
- distribution: fedora
init: /usr/lib/systemd/systemd
version: 26
- distribution: fedora
init: /usr/lib/systemd/systemd
version: 25
- distribution: fedora
init: /usr/lib/systemd/systemd
version: 24
- distribution: ubuntu
init: /lib/systemd/systemd
version: bionic
- distribution: ubuntu
init: /lib/systemd/systemd
version: xenial
# - distribution: ubuntu
# init: /sbin/init
# version: trusty
- distribution: debian
init: /lib/systemd/systemd
version: stretch
# - distribution: debian
# init: /lib/systemd/systemd
# version: jessie
before_install:
- "sudo pip install yamllint"
- yamllint -c .yamllint.yml .
- "sudo docker pull ${distribution}:${version}"
- "sudo docker build --no-cache --rm --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests"
script:
- container_id=$(mktemp)
- role_name="ansible-rabbitmq"
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/${role_name}:ro ${distribution}-${version}:ansible ${init} > "${container_id}"'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-lint -c /.ansible-lint /etc/ansible/roles/${role_name}/tests/test.yml'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/${role_name}/tests/test.yml --syntax-check'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/${role_name}/tests/test.yml'
- >
sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/${role_name}/tests/test.yml
| 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})"'
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|