-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
19 lines (16 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
---
sudo: required
services:
- docker
before_install:
- 'sudo docker pull solita/ubuntu-systemd'
- 'sudo docker build --no-cache --rm --file=ansible/tests/Dockerfile --tag=test:ansible ansible/tests'
script:
- container_id=$(mktemp)
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/:ro test:ansible > "${container_id}"'
- 'sudo docker exec "$(cat ${container_id})" adduser vpn_admin --gecos "" --home /home/vpn_admin --disabled-password'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/ansible/tests/test.yml --syntax-check'
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v -i /etc/ansible/roles/ansible/tests/inventory.yml /etc/ansible/roles/ansible/tests/test.yml --connection=local'
- 'sudo docker exec "$(cat ${container_id})" netcat -vz localhost 22'
- 'sudo docker exec "$(cat ${container_id})" netcat -vz -u localhost 1194'
- 'sudo docker rm -f "$(cat ${container_id})"'