forked from netbox-community/ansible_modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
72 lines (65 loc) · 3.17 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
language: python
services:
- docker
sudo: false
env:
global:
- COLLECTION_NAMESPACE: netbox
- COLLECTION_NAME: netbox
- COLLECTION_VERSION: 0.1.10
- secure: "tE6GtwrRU+Kjobx/94xqR2MqM20pHCnrLcHgPzIHA3npdwuA+GjCBiBLTkEEQM4fUWIfzUTyjSr9bZErm1PTI1GcIRdniTgJ3ZzSSkE7tgeYALB/7xsusB57SlmbBQm2SGwU558uWZ3NHEsi0WTgD8GKZo77OpGX72FZKsVXOz6k2wve51sOtoSVjgCsvWTmZHx4ynGdiA5wFkZfaEcjXECahKtunW+MlB5kpJzkVeLRUEXFMhWlsIYiA5nj8OI/X3Nk9ugh1ribENX9LrjpgrqQ9YariZ8G6py1ONuKZIn2g7xs5kNQ3qL6HL6N7SoUxiwH16CfSyugFaYiMfaxQ4NUVGGRHS4vSGbNIf+gLHcYvP40miI1f/+pntCzqygZMhW73FX2o+KH2OGv09khOl8k1nDg2/XvW0kCc/FU6l+Jp5wCC8H9X2uiULtQpRqts5TzIonlPEzGIpfGFgJ5m54Emhv9gjG1Z5OOyL/qae1Wr+L/uhiFafcglZYh8NHEMWCUCkeqFqR2kDmUMtdgYLD7Q7NdwlL/PSVVs1l7UPiQHlnecQKEHN7CvR3eKByTEmkCKafRYh/JQ9rBt9sZc7aAPVu+w3wWUwbHS4o4vVnmyXvJb1PeJSiuynF7CBo4Qd6qj4YwX8gLK6PylGyaMOp169u6xw1mo5/CX0pJ3x4="
matrix:
include:
- name: "Python 3.6 - Netbox 2.5 - Latest PyPi Ansible"
python: 3.6
env: PYTHON_VER=3.6 VERSION=v2.5
install:
- cd ..
# Setup netbox container for integration testing
- git clone https://github.com/FragmentedPacket/netbox-docker.git
- cd netbox-docker
- docker-compose pull
- docker-compose up -d
- cd ..
- pip install -U pip
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0
- pip install pynetbox cryptography codecov jmespath ansible
- name: "Python 3.6 - Netbox 2.6 - Ansible Devel"
python: 3.6
env: PYTHON_VER=3.6 VERSION=v2.6
install:
- cd ..
# Setup netbox container for integration testing
- git clone https://github.com/FragmentedPacket/netbox-docker.git
- cd netbox-docker
- docker-compose pull
- docker-compose up -d
- cd ..
- pip install -U pip
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.10b0
- pip install pynetbox cryptography jmespath
- git clone https://github.com/ansible/ansible.git
- cd ansible
- source hacking/env-setup
- cd ..
before_script:
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
- cp -R ansible_modules ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
- cd ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
- ansible-galaxy collection build .
- ansible-galaxy collection install $COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz -p /home/travis/.ansible/collections
script:
- ansible-test units --python $PYTHON_VER -v
- black . --check
- timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:32768)" != "200" ]]; do echo "waiting for Netbox"; sleep 5; done' || false
- python tests/integration/netbox-deploy.py
- ansible-playbook tests/integration/regression-tests.yml -vvvv
- ansible-playbook tests/integration/integration-tests.yml -vvvv
- ansible-inventory -i tests/integration/test-inventory.yml --list
deploy:
provider: script
skip_cleanup: true
script: ansible-galaxy collection publish $COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz --api-key="$GALAXY_API_TOKEN"
on:
tags: true