Adjust Travis file for easier maintenance.

pull/14/head
Jeff Geerling 8 years ago
parent ca23b73996
commit 373fa29f60
  1. 19
      .travis.yml
  2. 2
      README.md
  3. 2
      tests/test.yml

@ -2,24 +2,19 @@
sudo: required
env:
- repository: geerlingguy/docker-centos7-ansible
version: latest
- distro: centos7
init: /usr/lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- repository: geerlingguy/docker-centos6-ansible
version: latest
- distro: centos6
init: /sbin/init
run_opts: ""
- repository: geerlingguy/docker-ubuntu1604-ansible
version: latest
- distro: ubuntu1604
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- repository: geerlingguy/docker-ubuntu1404-ansible
version: latest
- distro: ubuntu1404
init: /sbin/init
run_opts: ""
- repository: geerlingguy/docker-ubuntu1204-ansible
version: latest
- distro: ubuntu1204
init: /sbin/init
run_opts: ""
@ -28,12 +23,12 @@ services:
before_install:
# Pull container.
- 'sudo docker pull ${repository}:${version}'
- 'sudo docker pull geerlingguy/docker-${distro}-ansible:latest'
script:
- container_id=$(mktemp)
# 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}"'
# Install dependencies.
- 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml'

@ -54,4 +54,4 @@ MIT / BSD
## Author Information
This role was created in 2016 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/).
This role was created in 2016 by [Jeff Geerling](http://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).

@ -4,7 +4,7 @@
pre_tasks:
- name: Update apt cache.
apt: update_cache=yes
when: ansible_distribution == 'Ubuntu'
when: ansible_os_family == 'Debian'
roles:
- geerlingguy.git

Loading…
Cancel
Save