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 sudo: required
env: env:
- 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: ""
@ -28,12 +23,12 @@ services:
before_install: before_install:
# 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}"'
# Install dependencies. # Install dependencies.
- 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/role_under_test/tests/requirements.yml' - '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 ## 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: pre_tasks:
- name: Update apt cache. - name: Update apt cache.
apt: update_cache=yes apt: update_cache=yes
when: ansible_distribution == 'Ubuntu' when: ansible_os_family == 'Debian'
roles: roles:
- geerlingguy.git - geerlingguy.git

Loading…
Cancel
Save