-
Notifications
You must be signed in to change notification settings - Fork 39
/
.travis.yml
75 lines (68 loc) · 2.2 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
language: python
sudo: required
services:
- docker
addons:
apt:
packages:
- ansible
env:
- distribution: ubuntu
version: xenial
playbook: same_key.yml
- distribution: ubuntu
version: xenial
playbook: different_keys.yml
- distribution: ubuntu
version: xenial
playbook: sendmail.yml
- distribution: ubuntu
version: bionic
playbook: same_key.yml
- distribution: ubuntu
version: bionic
playbook: different_keys.yml
- distribution: ubuntu
version: bionic
playbook: sendmail.yml
- distribution: ubuntu
version: focal
playbook: same_key.yml
- distribution: ubuntu
version: focal
playbook: different_keys.yml
- distribution: ubuntu
version: focal
playbook: sendmail.yml
- distribution: debian
version: stretch
playbook: same_key.yml
- distribution: debian
version: stretch
playbook: different_keys.yml
- distribution: debian
version: stretch
playbook: sendmail.yml
- distribution: debian
version: buster
playbook: same_key.yml
- distribution: debian
version: buster
playbook: different_keys.yml
- distribution: debian
version: buster
playbook: sendmail.yml
before_install:
- 'sudo docker pull ${distribution}:${version}'
- 'sudo docker build --no-cache --rm -f tests/${distribution}/${version}/Dockerfile -t ${distribution}-${version}:ansible tests'
script:
- container_id=$(mktemp)
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v "${PWD}":/etc/ansible/roles/dkim:ro ${distribution}-${version}:ansible > "${container_id}"'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/dkim/tests/${playbook} --syntax-check'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/dkim/tests/${playbook}'
# - >
# sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/dkim/tests/${playbook}
# | 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})"'