forked from netbox-community/ansible_modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
64 lines (58 loc) · 2.33 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
---
language: python
services:
- docker
sudo: false
env:
global:
- COLLECTION_NAMESPACE: fragmentedpacket
- COLLECTION_NAME: netbox_modules
- COLLECTION_VERSION: 0.1.0
matrix:
include:
- name: "Python 3.6 - Netbox 2.5 - Ansible 2.9"
python: 3.6
env: PYTHON_VER=3.6 VERSION=v2.5 ANSIBLE_VER=2.9.0
install:
- cd ..
# Setup netbox container for integration testing
- git clone https://github.com/FragmentedPacket/netbox-docker.git
- cd netbox-docker
- git checkout startup-dcim-interfaces-2.5
- 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.3b0
- pip install pynetbox==4.0.6 cryptography codecov jmespath ansible==$ANSIBLE_VER
- name: "Python 3.6 - Netbox Latest - Ansible Devel"
python: 3.6
env: PYTHON_VER=3.6 VERSION=v2.6.6
install:
- cd ..
# Setup netbox container for integration testing
- git clone https://github.com/netbox-community/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.3b0
- pip install pynetbox==4.0.6 cryptography jmespath
# This is due to ansible-test only being available within devel branch
- 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 $COLLECTION_NAME ~/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/integration-tests.yml -v