mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2024-12-22 19:10:19 +01:00
Adjust Travis file for easier maintenance.
This commit is contained in:
parent
ccfb1fbcb7
commit
0b7cd353c0
2 changed files with 9 additions and 14 deletions
21
.travis.yml
21
.travis.yml
|
@ -6,24 +6,19 @@ env:
|
||||||
# https://github.com/travis-ci/travis-ci/issues/6461#issuecomment-239577306
|
# https://github.com/travis-ci/travis-ci/issues/6461#issuecomment-239577306
|
||||||
DOCKER_VERSION: "1.9.1-0~trusty"
|
DOCKER_VERSION: "1.9.1-0~trusty"
|
||||||
matrix:
|
matrix:
|
||||||
- repository: geerlingguy/docker-centos7-ansible
|
- distro: centos7
|
||||||
version: latest
|
|
||||||
init: /usr/lib/systemd/systemd
|
init: /usr/lib/systemd/systemd
|
||||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||||
- repository: geerlingguy/docker-centos6-ansible
|
- distro: centos6
|
||||||
version: latest
|
|
||||||
init: /sbin/init
|
init: /sbin/init
|
||||||
run_opts: ""
|
run_opts: ""
|
||||||
- repository: geerlingguy/docker-ubuntu1604-ansible
|
- distro: ubuntu1604
|
||||||
version: latest
|
|
||||||
init: /lib/systemd/systemd
|
init: /lib/systemd/systemd
|
||||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||||
- repository: geerlingguy/docker-ubuntu1404-ansible
|
- distro: ubuntu1404
|
||||||
version: latest
|
|
||||||
init: /sbin/init
|
init: /sbin/init
|
||||||
run_opts: ""
|
run_opts: ""
|
||||||
- repository: geerlingguy/docker-ubuntu1204-ansible
|
- distro: ubuntu1204
|
||||||
version: latest
|
|
||||||
init: /sbin/init
|
init: /sbin/init
|
||||||
run_opts: ""
|
run_opts: ""
|
||||||
|
|
||||||
|
@ -37,12 +32,12 @@ before_install:
|
||||||
- sudo apt-get install docker-engine=$DOCKER_VERSION -yq --no-install-suggests --no-install-recommends --force-yes -o Dpkg::Options::="--force-confnew"
|
- sudo apt-get install docker-engine=$DOCKER_VERSION -yq --no-install-suggests --no-install-recommends --force-yes -o Dpkg::Options::="--force-confnew"
|
||||||
|
|
||||||
# Pull container.
|
# Pull container.
|
||||||
- 'sudo docker pull ${repository}:${version}'
|
- 'sudo docker pull geerlingguy/docker-${distro}-ansible:latest'
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- container_id=$(mktemp)
|
- container_id=$(mktemp)
|
||||||
# Run container in detached state.
|
# Run container in detached state.
|
||||||
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${repository}:${version} "${init}" > "${container_id}"'
|
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} geerlingguy/docker-${distro}-ansible:latest "${init}" > "${container_id}"'
|
||||||
|
|
||||||
# Ansible syntax check.
|
# Ansible syntax check.
|
||||||
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check'
|
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check'
|
||||||
|
@ -59,7 +54,7 @@ script:
|
||||||
&& (echo 'Idempotence test: pass' && exit 0)
|
&& (echo 'Idempotence test: pass' && exit 0)
|
||||||
|| (echo 'Idempotence test: fail' && exit 1)
|
|| (echo 'Idempotence test: fail' && exit 1)
|
||||||
|
|
||||||
# Clean up
|
# Clean up.
|
||||||
- 'sudo docker stop "$(cat ${container_id})"'
|
- 'sudo docker stop "$(cat ${container_id})"'
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
|
|
|
@ -121,4 +121,4 @@ MIT / BSD
|
||||||
|
|
||||||
## Author Information
|
## Author Information
|
||||||
|
|
||||||
This role was created in 2014 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/).
|
This role was created in 2014 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
|
||||||
|
|
Loading…
Reference in a new issue