Use global environment variable in Travis build matrix
This commit is contained in:
parent
4281c51dbc
commit
60331d7b39
39
.travis.yml
39
.travis.yml
@ -3,32 +3,33 @@ sudo: required
|
|||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
env:
|
env:
|
||||||
- distribution: centos
|
global:
|
||||||
version: 6
|
- playbook: opensource
|
||||||
- distribution: centos
|
- playbook: template
|
||||||
version: 7
|
- playbook: upload
|
||||||
- distribution: ubuntu
|
matrix:
|
||||||
version: trusty
|
- distribution: centos
|
||||||
- distribution: ubuntu
|
version: 6
|
||||||
version: xenial
|
- distribution: centos
|
||||||
- distribution: debian
|
version: 7
|
||||||
version: jessie
|
- distribution: ubuntu
|
||||||
- distribution: debian
|
version: trusty
|
||||||
version: stretch
|
- distribution: ubuntu
|
||||||
tests:
|
version: xenial
|
||||||
- opensource
|
- distribution: debian
|
||||||
- template
|
version: jessie
|
||||||
- upload
|
- distribution: debian
|
||||||
|
version: stretch
|
||||||
before_install:
|
before_install:
|
||||||
- 'sudo docker pull ${distribution}:${version}'
|
- 'sudo docker pull ${distribution}:${version}'
|
||||||
- 'sudo docker build --no-cache --rm --file=tests/dockerfiles/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'
|
- 'sudo docker build --no-cache --rm --file=tests/dockerfiles/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'
|
||||||
script:
|
script:
|
||||||
- container_id=$(mktemp)
|
- container_id=$(mktemp)
|
||||||
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/ansible-role-nginx:ro ${distribution}-${version}:ansible > "${container_id}"'
|
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/ansible-role-nginx:ro ${distribution}-${version}:ansible > "${container_id}"'
|
||||||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-nginx/tests/playbooks/nginx-${tests}.yml --syntax-check'
|
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-nginx/tests/playbooks/nginx-${playbook}.yml --syntax-check'
|
||||||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-nginx/tests/playbooks/nginx-${tests}.yml'
|
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-nginx/tests/playbooks/nginx-${playbook}.yml'
|
||||||
- >
|
- >
|
||||||
sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-nginx/tests/playbooks/nginx-${tests}.yml
|
sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-nginx/tests/playbooks/nginx-${playbook}.yml
|
||||||
| grep -q 'changed=0.*failed=0'
|
| grep -q 'changed=0.*failed=0'
|
||||||
&& (echo 'Idempotence test: pass' && exit 0)
|
&& (echo 'Idempotence test: pass' && exit 0)
|
||||||
|| (echo 'Idempotence test: fail' && exit 1)
|
|| (echo 'Idempotence test: fail' && exit 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user