-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
32 lines (24 loc) · 1.05 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
---
sudo: required
services:
- docker
before_install:
# Add current user to docker group and build image
- sudo usermod -aG docker $(whoami)
- docker build --rm=true --file=./tests/Dockerfile --tag=ubuntu:ansible tests
script:
# start container
- container_id=$(mktemp)
- docker run --detach --volume="${PWD}":/etc/ansible/roles/test_role:ro ubuntu:ansible /sbin/init > ${container_id}
# check syntax and test role
- docker exec --tty "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/test_role/tests/test.yml --syntax-check
- docker exec --tty "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/test_role/tests/test.yml
# ensure node & npm is installed
- docker exec --tty "$(cat ${container_id})" which node
- docker exec --tty "$(cat ${container_id})" node --version
- docker exec --tty "$(cat ${container_id})" which npm
- docker exec --tty "$(cat ${container_id})" npm --version
# cleanup
- docker stop "$(cat ${container_id})"
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/