Merge branch 'master' of https://github.com/bertvv/ansible-role-apache into bertvv-master

This commit is contained in:
Jeff Geerling 2015-12-14 08:36:55 -06:00
commit e5f3ba3bf1
4 changed files with 34 additions and 25 deletions

View file

@ -1,27 +1,20 @@
sudo: required sudo: required
env: env:
# CentOS 7.
- distribution: centos - distribution: centos
version: 7 version: 6
container_id: $(mktemp)
dockerfile: Dockerfile.centos-7
init: /usr/lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
# Ubuntu 12.04.
- distribution: ubuntu
version: 12.04
container_id: $(mktemp)
dockerfile: Dockerfile.ubuntu-12
init: /sbin/init init: /sbin/init
run_opts: "" run_opts: ""
- distribution: centos
# Ubuntu 14.04. version: 7
init: /usr/lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distribution: ubuntu - distribution: ubuntu
version: 14.04 version: 14.04
container_id: $(mktemp) init: /sbin/init
dockerfile: Dockerfile.ubuntu-14 run_opts: ""
- distribution: ubuntu
version: 12.04
init: /sbin/init init: /sbin/init
run_opts: "" run_opts: ""
@ -30,14 +23,15 @@ services:
before_install: before_install:
- sudo apt-get update - sudo apt-get update
# Pull container. # Pull container
- "sudo docker pull ${distribution}:${version}" - 'sudo docker pull ${distribution}:${version}'
# Customize container. # Customize container
- "sudo docker build --rm=true --file=tests/${dockerfile} --tag=${distribution}:ansible tests" - 'sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'
script: script:
# Run container in detached state. - container_id=$(mktemp)
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}:ansible "${init}" > "${container_id}"' # Run container in detached state
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${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'

11
tests/Dockerfile.centos-6 Normal file
View file

@ -0,0 +1,11 @@
FROM centos:6
RUN yum -y update; yum clean all;
RUN yum -y install epel-release
RUN yum -y install git ansible sudo
RUN yum clean all
# Disable requiretty
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
# Install Ansible inventory file
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
CMD ["/usr/sbin/init"]

View file

@ -1,10 +1,15 @@
FROM ubuntu:12.04 FROM ubuntu:12.04
<<<<<<< HEAD:tests/Dockerfile.ubuntu-12
# Install Ansible # Install Ansible
RUN apt-get install -y software-properties-common python-software-properties git RUN apt-get install -y software-properties-common python-software-properties git
=======
# Install Ansible
RUN apt-get install -y python-software-properties software-properties-common git
>>>>>>> 3a993606b22d1162ecea3a8f595b3d17410a8450:tests/Dockerfile.ubuntu-12.04
RUN apt-add-repository -y ppa:ansible/ansible RUN apt-add-repository -y ppa:ansible/ansible
RUN apt-get update RUN apt-get update
RUN apt-get install -y ansible RUN apt-get install -y ansible
# Install Ansible inventory file # Install Ansible inventory file
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts

View file

@ -1,10 +1,9 @@
FROM ubuntu:14.04 FROM ubuntu:14.04
# Install Ansible # Install Ansible
RUN apt-get install -y software-properties-common git RUN apt-get install -y software-properties-common git
RUN apt-add-repository -y ppa:ansible/ansible RUN apt-add-repository -y ppa:ansible/ansible
RUN apt-get update RUN apt-get update
RUN apt-get install -y ansible RUN apt-get install -y ansible
# Install Ansible inventory file # Install Ansible inventory file
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts