-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (45 loc) · 1.57 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
# Following https://www.jeffgeerling.com/blog/testing-ansible-roles-travis-ci-github
---
language: python
python: "2.7"
addons:
apt:
packages:
- python-pip
- redis-tools
env:
global:
# Defaults
test_host: localhost
snappass_port: 5000
redis_port: 6400
matrix:
- snappass_repo_url: https://github.com/pinterest/snappass
- snappass_repo_url: https://github.com/jameswthorne/snappass
before_install:
# Make sure everything's up to date.
- sudo apt-get update -qq
install:
# Install Ansible
- pip install ansible
# Install deps
- ansible-galaxy install geerlingguy.pip geerlingguy.docker derekmerck.redis_docker
script:
# We'll add some commands to test the role here.
# Check the role/playbook's syntax.
- 'ansible-playbook -i tests/test_inv.yml tests/test_play.yml --syntax-check
-e test_host=${test_host}'
# Run the role/playbook with ansible-playbook.
# add "-vvv" for complete output for debugging
- 'ansible-playbook -i tests/test_inv.yml tests/test_play.yml --connection=local --sudo
-e test_host=${test_host}'
# # Run the role/playbook again, checking to make sure it's idempotent.
# - >
# ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo
# | grep -q 'changed=0.*failed=0'
# && (echo 'Idempotence test: pass' && exit 0)
# || (echo 'Idempotence test: fail' && exit 1)
# Request a page via the web server, to make sure it's running and responds.
- "curl http://localhost:${snappass_port}/"
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/