Skip to content

Commit 3f9e8cf

Browse files
Clean up .travis.yml (#8)
1 parent 833b2dd commit 3f9e8cf

File tree

1 file changed

+23
-58
lines changed

1 file changed

+23
-58
lines changed

.travis.yml

Lines changed: 23 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13,107 +13,72 @@ env:
1313

1414
matrix:
1515
include:
16-
- name: "Python 3.6 - units"
16+
- name: "Python 3.6 - Netbox 2.5"
1717
python: 3.6
18-
env: PYTHON_VER=3.6
18+
env: PYTHON_VER=3.6 VERSION=v2.5
1919
install:
2020
- pip install -U pip
2121
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.3b0
22+
- pip install pynetbox==4.0.6 cryptography codecov
2223
- cd ../../
2324
# This is due to ansible-test only being available within devel branch
2425
- git clone https://github.com/ansible/ansible.git
2526
- cd ansible
2627
- git checkout stable-2.9
2728
- source hacking/env-setup
2829
- cd ..
29-
30-
before_script:
31-
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
32-
- mv FragmentedPacket/$COLLECTION_NAME ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
33-
- cd ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
34-
35-
script:
36-
- ansible-test units --python $PYTHON_VER -vvv
37-
- black . --check
38-
39-
- name: "Python 3.7 - units"
40-
python: 3.7
41-
env: PYTHON_VER=3.7
42-
install:
43-
- pip install -U pip
44-
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.3b0
45-
- cd ../../
46-
# This is due to ansible-test only being available within devel branch
47-
- git clone https://github.com/ansible/ansible.git
48-
- cd ansible
49-
- git checkout stable-2.9
50-
- source hacking/env-setup
51-
- cd ..
52-
53-
before_script:
54-
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
55-
- mv FragmentedPacket/$COLLECTION_NAME ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
56-
- cd ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
57-
58-
script:
59-
- ansible-test units --python $PYTHON_VER -vvv
60-
- black . --check
61-
62-
- name: "Python 3.6 / Netbox 2.5 - integration"
63-
python: 3.6
64-
# This is set and used by netbox-docker to pull the correct Netbox image
65-
env: VERSION=v2.5
66-
install:
67-
- pip install -U pip
68-
- pip install jinja2 PyYAML pynetbox==4.0.6 cryptography
69-
- cd ../../
70-
- git clone https://github.com/ansible/ansible.git
71-
- cd ansible
72-
- git checkout stable-2.9
73-
- source hacking/env-setup
74-
- cd ..
30+
# Setup netbox container for integration testing
7531
- git clone https://github.com/netbox-community/netbox-docker.git
7632
- cd netbox-docker
7733
- docker-compose --verbose pull
7834
- docker-compose --verbose up -d
7935
- cd ..
80-
36+
8137
before_script:
82-
- cd FragmentedPacket/netbox_modules
83-
- mkdir ansible_collections
38+
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
39+
- cp -R FragmentedPacket/$COLLECTION_NAME ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
40+
- cd ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
8441
- ansible-galaxy collection build .
8542
- ansible-galaxy collection install $COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz -p /home/travis/.ansible/collections
86-
43+
8744
script:
45+
- ansible-test units --python $PYTHON_VER -vvv
46+
- black . --check
8847
- "sleep 60"
8948
- python tests/integration/netbox-deploy.py
9049
- ansible-playbook tests/integration/integration-tests.yml -v
9150

92-
- name: "Python 3.6 / Netbox 2.6 - integration"
51+
- name: "Python 3.6 - Netbox 2.6"
9352
python: 3.6
94-
# This is set and used by netbox-docker to pull the correct Netbox image
95-
env: VERSION=v2.6
53+
env: PYTHON_VER=3.6 VERSION=v2.6
9654
install:
9755
- pip install -U pip
98-
- pip install jinja2 PyYAML pynetbox==4.0.6 cryptography
56+
- pip install pytest==4.6.5 pytest-mock pytest-xdist jinja2 PyYAML black==19.3b0
57+
- pip install pynetbox==4.0.6 cryptography
9958
- cd ../../
59+
# This is due to ansible-test only being available within devel branch
10060
- git clone https://github.com/ansible/ansible.git
10161
- cd ansible
10262
- git checkout stable-2.9
10363
- source hacking/env-setup
10464
- cd ..
65+
# Setup netbox container for integration testing
10566
- git clone https://github.com/netbox-community/netbox-docker.git
10667
- cd netbox-docker
10768
- docker-compose --verbose pull
10869
- docker-compose --verbose up -d
10970
- cd ..
11071

11172
before_script:
112-
- cd FragmentedPacket/netbox_modules
73+
- mkdir -p ~/ansible_collections/$COLLECTION_NAMESPACE
74+
- cp -R FragmentedPacket/$COLLECTION_NAME ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
75+
- cd ~/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
11376
- ansible-galaxy collection build .
11477
- ansible-galaxy collection install $COLLECTION_NAMESPACE-$COLLECTION_NAME-$COLLECTION_VERSION.tar.gz -p /home/travis/.ansible/collections
115-
78+
11679
script:
80+
- ansible-test units --python $PYTHON_VER -vv
81+
- black . --check
11782
- "sleep 60"
11883
- python tests/integration/netbox-deploy.py
11984
- ansible-playbook tests/integration/integration-tests.yml -v

0 commit comments

Comments
 (0)