This repository has been archived by the owner on May 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
73 lines (66 loc) · 2.16 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
---
language: python
python:
# - 2.7
# - 3.3
# - 3.4
# - 3.5
- 3.6
services:
- docker
cache:
bundler:
directories:
- $HOME/.cache/pip
env:
global:
- JENKINS_HOME=/home/jenkins
- JENKINS_UID=3000
- DOCKER_GID=999
- secure: MD73NCVzctbVmi2QnQtwtH/ISXN2K0alsLbixoaXl7gr3XvTB4sYB0u+KKtPV46jbeAlQqTRObPfQouPrsLsiNDYcpuN0I5bKsn3TTs4ZHIkD0I2Q9Wh3qNM2fYf9mw3ZUhvXVTEod0W7jzkVGb6kitRCJj8rioKKzvE/YdVsG4=
matrix:
# - ANSIBLE_VERSION=latest
- ANSIBLE_VERSION=2.7.2
sudo: required
dist: trusty
branches:
only:
- master
virtualenv:
system_site_packages: false
before_install:
- sudo apt-get update -qq
- sudo apt-get install curl
- sudo apt-get install -qq python-apt python-pycurl
install:
# Install Ansible.
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible-lint; fi
# Add ansible.cfg to pick up roles path.
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
# Prepare tests
# Add user jenkins to the image (travis is 2000)
- id -a
- getent passwd 3000 || true # 3000 not found we can use it for jenkins user
# - groupadd -g ${DOCKER_GID} docker && \
# - sudo adduser --quiet --disabled-password --shell /bin/bash --uid ${JENKINS_UID} --gid ${DOCKER_GID} --home ${JENKINS_HOME} --gecos "Jenkins" jenkins
# Set password for the jenkins user (you may want to alter this).
# - sudo echo "jenkins:jenkins1234" | sudo chpasswd
- pip install molecule
script:
# Check ansible version
- ansible --version
# Check syntax
- ansible-playbook -i ./hosts --syntax-check ./webmin.yml -vvvv --connection=local -e "python_versions=[2.7]"
# Molecule test
# - molecule test
# First run
# Run the role/playbook with ansible-playbook.
- ansible-playbook -i ./hosts ./webmin.yml --connection=local -vvvv -e "python_versions=[2.7]"
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
email:
recipients:
- alban.andrieu@nabla.mobi
on_success: [always|never|change] # default: change
on_failure: [always|never|change] # default: always