-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
73 lines (60 loc) · 2.19 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
73
---
##
# The Travis CI build for this project.
##
# These defaults are used for all tetsts runu on Linux, and are overridden
# for Mac OS X.
os: linux
dist: xenial
language: python
python: 3.7
# Some tests will be run in Docker containers spun up by and hosted on the
# Travis CI test host, to verify compatibility with various Linux distros.
services:
- docker
# Install Python 3 and pipenv for Mac OS X.
addons:
homebrew:
packages:
- python@3
- pipenv
update: true
env:
global:
- ROLE=karlmdavis.rcm-dotfiles
- CONTAINER_PREFIX=ansible_test_rcm_dotfiles
# Each list item here will be run as a separate test by Travis CI.
matrix:
include:
- os: osx
language: minimal
env: TEST_PLAY=test_basic.yml TEST_VARS=default_MacOSX TARGET=localhost PLATFORM= ANSIBLE_SPEC="ansible"
- env: TEST_PLAY=test_basic.yml TEST_VARS=default TARGET=localhost PLATFORM= ANSIBLE_SPEC="ansible"
- env: TEST_PLAY=test_basic.yml TEST_VARS=default TARGET=localhost PLATFORM= ANSIBLE_SPEC="ansible==2.7.10"
- env: TEST_PLAY=test_basic.yml TEST_VARS=default TARGET=docker PLATFORM=ubuntu_16_04 ANSIBLE_SPEC="ansible"
- env: TEST_PLAY=test_basic.yml TEST_VARS=no_internet TARGET=docker PLATFORM=centos_7 ANSIBLE_SPEC="ansible"
install:
# On Linux, install pipenv (already installed, up above, on Mac OS X).
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip3 install pipenv; fi
# Generate an SSH key for use when connecting to Docker containers.
- ssh-keygen -t rsa -N '' -f ${HOME}/.ssh/id_rsa
# Prepare to run the tests.
- ./test/pre-test.sh ${HOME}/.ssh/id_rsa.pub
script:
# Run the tests.
- test/test.sh
after_script:
# Inspect the management host environment a bit post-test. Just to aid in debugging.
- pwd
- ls -la ../
- ls -la ./
- ls -la ./roles/
# Inspect the Docker container a bit post-test. Just to aid in debugging.
- |
if [[ "${TARGET}" == "docker" ]]; then
docker exec ${CONTAINER_PREFIX}.${PLATFORM} ls -la /home/ansible_test/
fi
# Clean up after the test.
- test/post-test.sh
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/