-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
68 lines (56 loc) · 2.11 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
---
language: python
python: "2.7"
env:
- SITE=test.yml
notifications:
slack:
secure: KbZLE1Hv+2C/ip+mdzNHOaLBYHHLmdcl2ty0A9Sz/ov2isoq0HEefyAa70Bj3CgjzvKYaY1Dh9209c0Ve1D23KVE8DvYVKBHtIcQwjhC+BIp9azzHQ7tPcvMPSdpzuX16iaDfHCHDNjFVWj4XwXwnnucwDqnR6NBW3tMgon3Cx4=
before_install:
# Make sure everything's up to date.
- export DEBIAN_FRONTEND=noninteractive
- sudo apt-get remove --purge git tree vim curl wget
- sudo apt-get remove -qq postgresql*
- sudo apt-get update -qq
- sudo apt-get -o Dpkg::Options::="--force-confnew" upgrade -qq -y
- sudo apt-get -o Dpkg::Options::="--force-confnew" install aptitude -y
install:
# Install Ansible.
- pip install ansible
# Add ansible.cfg to pick up roles path.
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
script:
# Check the role/playbook's syntax.
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check"
# Run the role/playbook with ansible-playbook.
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local"
# Run the role/playbook again, checking to make sure it's idempotent.
- >
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
## Check to make sure git package is installed.
- >
which git
| grep -q '/usr/bin/git'
&& (echo 'Package install test: pass' && exit 0)
|| (echo 'Package install test: fail' && exit 1)
## Check to make sure zsh package is installed.
- >
which zsh
| grep -q '/usr/bin/zsh'
&& (echo 'Package install test: pass' && exit 0)
|| (echo 'Package install test: fail' && exit 1)
## Check to make sure .zshrc file is installed.
- >
ls ~/.zshrc
| grep -q '.zshrc'
&& (echo 'Package install test: pass' && exit 0)
|| (echo 'Package install test: fail' && exit 1)
## Check to make sure .zshrc file is installed.
- >
cat ~/.zshrc
| grep invert -q '{{ ZSH_THEME }}'
&& (echo 'Package install test: pass' && exit 0)
|| (echo 'Package install test: fail' && exit 1)