-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
40 lines (29 loc) · 1.7 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
sudo: required
language: python
services: docker
env:
matrix:
- distribution: Debian
distribution_version: stretch
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
before_install:
# Pull container from Docker Hub.
- 'docker pull ansiblecheck/ansiblecheck:${distribution,,}-${distribution_version}'
script:
- container_id=$(mktemp)
# Start The Built Container In The Background
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ansiblecheck/ansiblecheck:"${distribution,,}"-"${distribution_version}" "${init}" > "${container_id}"'
# Ansible version check.
- 'docker exec --tty "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=true ansible --version'
# Run linters, does not fail the job in case of errors
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-lint -c /etc/ansible/roles/role_under_test/.ansible-lint /etc/ansible/roles/role_under_test/ || true'
- 'docker exec --tty "$(cat ${container_id})" env TERM=xterm yamllint -c /etc/ansible/roles/role_under_test/.yamllint /etc/ansible/roles/role_under_test/ || true'
# Install requirements, Uncomment if needed
#- 'docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=true ansible-galaxy install -v -r /etc/ansible/roles/role_under_test/requirements.yml'
# Ansible syntax check.
- 'docker exec --tty "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=true ansible-playbook /etc/ansible/roles/role_under_test/tests/test.yml --syntax-check'
# Add your own tests depending on your $ROLE
- echo "=======> Proxmox does not install on Travis-CI"
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/