forked from CSCfi/ansible-role-jetty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (54 loc) · 1.89 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
services:
- docker
sudo: required
env:
# https://en.wikipedia.org/wiki/CentOS#Versioning_and_releases
- distribution: centos
version: 8
- distribution: centos
version: 7
# https://en.wikipedia.org/wiki/Fedora_(operating_system)#Releases
- distribution: fedora
version: 32
- distribution: fedora
version: 31
# https://en.wikipedia.org/wiki/Debian_version_history
# Buster
- distribution: debian
version: 10
# Stretch
- distribution: debian
version: 9
# https://en.wikipedia.org/wiki/Ubuntu#Releases
# 20.04 LTS
- distribution: ubuntu
version: focal
# 18.04 LTS
- distribution: ubuntu
version: bionic
before_install:
# - sudo apt-get update
- docker pull ${distribution}:${version}
- docker build --no-cache --rm=true --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests
script:
- container_id=$(mktemp)
- >-
docker run
--detach
--privileged
--volume /sys/fs/cgroup:/sys/fs/cgroup:ro
--volume "${PWD}":/etc/ansible/roles/ansible-role-jetty:ro
${distribution}-${version}:ansible
> "${container_id}"
- docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible --version
- docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-jetty/tests/test.yml --syntax-check
- docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-jetty/tests/test.yml
- >
docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible-role-jetty/tests/test.yml
| grep -q -E 'unreachable=0\s+failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- docker rm -f "$(cat ${container_id})"
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/