-
Notifications
You must be signed in to change notification settings - Fork 80
/
.travis.yml
55 lines (41 loc) · 1.79 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
---
os: linux
dist: xenial
env:
- distribution: centos
version: 7
- distribution: debian
version: stretch
# - distribution: debian
# version: jessie
- distribution: debian
version: buster
- distribution: ubuntu
version: 14.04
- distribution: ubuntu
version: 16.04
- distribution: ubuntu
version: 18.04
# - distribution: ubuntu
# version: 20.04
services:
- docker
before_install:
- 'sudo docker pull ${distribution}:${version}'
- 'sudo docker build --no-cache --rm --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'
script:
- container_id=$(mktemp)
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/Rocket.Chat.Ansible:ro ${distribution}-${version}:ansible > "${container_id}"'
# Verify Ansible is available in the container.
- sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible --version
# Verify Ansible Scripts
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/Rocket.Chat.Ansible/tests/travis.yml --syntax-check'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/Rocket.Chat.Ansible/tests/travis.yml'
# - >
# sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/Rocket.Chat.Ansible/tests/travis.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})"'
#notifications:
# webhooks: https://galaxy.ansible.com/api/v1/notifications/