-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
41 lines (35 loc) · 1.18 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
language: objective-c
sudo: true
cache:
directories:
- $HOME/Library/Caches/Homebrew
# osx_image: xcode9.1
matrix:
include:
# - os: linux
- os: osx
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated xctool || brew upgrade xctool; fi
install:
- sudo -H easy_install pip
- sudo -H pip install ansible
# Add ansible.cfg to pick up roles path.
# - "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
# Add a hosts file.
- sudo mkdir -p /etc/ansible
- sudo touch /etc/ansible/hosts
- "echo -e '[local]\nlocalhost ansible_connection=local' | sudo tee -a /etc/ansible/hosts > /dev/null"
script:
- ansible --version
- ansible-galaxy install -r requirements.yml
- ansible-playbook --syntax-check ./localhost.yml
- "travis_wait 30 ansible-playbook -i hosts localhost.yml"
# Test the playbook's idempotence.
- idempotence=$(mktemp)
- "ansible-playbook -i hosts localhost.yml | tee -a ${idempotence}"
- >
tail ${idempotence}
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)