mirror of
https://github.com/roles-ansible/ansible_role_dotfiles.git
synced 2024-08-16 16:09:49 +02:00
Experimentieren mit travis
This commit is contained in:
parent
075c4a8209
commit
0f003e7c83
1 changed files with 37 additions and 0 deletions
37
.travis.yml
Normal file
37
.travis.yml
Normal file
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
sudo: required
|
||||
|
||||
env:
|
||||
- distribution: centos
|
||||
version: 7
|
||||
- distribution: fedora
|
||||
version: 29
|
||||
- distribution: ubuntu
|
||||
version: bionic
|
||||
- distribution: ubuntu
|
||||
version: xenial
|
||||
- distribution: ubuntu
|
||||
version: trusty
|
||||
- distribution: debian
|
||||
version: stretch
|
||||
- distribution: debian
|
||||
version: jessie
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
before_install:
|
||||
- 'sudo docker pull ${distribution}:${version}'
|
||||
- 'sudo docker build --no-cache --rm --file=travis/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible travis'
|
||||
|
||||
script:
|
||||
- container_id=$(mktemp)
|
||||
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/nginx_role:ro ${distribution}-${version}:ansible > "${container_id}"'
|
||||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/nginx_role/travis/test.yml --syntax-check'
|
||||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/nginx_role/travis/test.yml'
|
||||
- >
|
||||
sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/nginx_role/travis/test.yml
|
||||
| grep -q 'changed=0.*failed=0'
|
||||
&& (echo 'Idempotence test: pass' && exit 0)
|
||||
|| (echo 'Idempotence test: fail' && exit 1)
|
||||
- 'sudo docker rm -f "$(cat ${container_id})"'
|
Loading…
Reference in a new issue