Add Ubuntu 12.04 as a platform to test

This commit is contained in:
Bert Van Vreckem 2015-12-14 00:00:39 +01:00
parent d8d1770482
commit a24482638b
4 changed files with 26 additions and 14 deletions

View file

@ -1,17 +1,20 @@
sudo: required sudo: required
env: env:
- > - distribution: centos
container_id=$(mktemp) version: 7
distribution=centos init: /usr/lib/systemd/systemd
version=7 run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
init=/usr/lib/systemd/systemd container_id: $(mktemp)
run_opts="--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro" - distribution: ubuntu
- > version: 14.04
container_id=$(mktemp) init: /sbin/init
distribution=ubuntu run_opts: ""
version=14.04 container_id: $(mktemp)
init=/sbin/init - distribution: ubuntu
run_opts="" version: 12.04
init: /sbin/init
run_opts: ""
container_id: $(mktemp)
services: services:
- docker - docker
@ -21,7 +24,7 @@ before_install:
# 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.${distribution} --tag=${distribution}:ansible tests - sudo docker build --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests
script: script:
# #
@ -29,7 +32,7 @@ script:
# #
# 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} ${distribution}:ansible "${init}" > "${container_id}" - sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"
# Syntax check # 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

View file

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