-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
76 lines (57 loc) · 2.12 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
74
75
76
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
- curl
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- mkdir -p extra_roles
- printf '[defaults]\nroles_path=../:extra_roles' >ansible.cfg
script:
# See if the repo is private
- if curl --silent --output /dev/null --dump-header - "https://github.com/${TRAVIS_REPO_SLUG}" | grep "Status:[[:space:]]*404"; then touch .private_repo; fi
# Download depended roles
- if [ -f requirements.yml ]; then ansible-galaxy install -r requirements.yml -p extra_roles; fi
# Basic role syntax check
#
# If it is a private repo, it _usually_ has secret information, or encrypted
# file. As the information security policy does not allow decryption key to
# be transfered to third-party, encrypted files cannot be decrypted in travis
# CI environment. Skip syntax check when it is a private repo.
#
- "if [ ! -f .private_repo ]; then ansible-playbook tests/travisci/tests.yml -i tests/travisci/inventory --syntax-check; fi"
# use recent ruby, instead of default ruby 1.9
- rvm install ruby-2.3.6
- rvm use 2.3.6
# download the QA scripts
- git clone https://github.com/reallyenglish/qansible.git
# checkout the reallyengnlish-master branch
- ( cd qansible && git checkout reallyenglish-master )
# install it
- ( cd qansible && bundle install --path vendor/bundle --with "test" && bundle exec rake build && gem install pkg/*.gem )
- rm -rf qansible
# git complains if user and email are not set
- git config --global user.name "Your Name"
- git config --global user.email "you@example.com"
# surpress a warning from `qansible qa
- touch .kitchen.local.yml
# export PATH
- export PATH="${PATH}:`rvm gemdir`/bin"
# bundle up because rubocop is installed via Gemfile
- bundle install --path vendor/bundle
# run rubocop
- bundle exec rubocop
# run the QA test
- qansible qa
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/