/
.travis.yml
50 lines (41 loc) · 1.54 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
# Leverage 14.04 LTS, same as Vagrant
sudo: required
dist: trusty
# Set our language to generic for a minimal setup
# https://docs.travis-ci.com/user/trusty-ci-environment#Image-differences-from-Precise
language: generic
# Test both provisioning on an existing and fresh machine
# DEV: Provisioning on an existing machine catches edge cases like forgetting to delete files
env:
- BOOTSTRAP_LAST_TAG=FALSE
- BOOTSTRAP_LAST_TAG=TRUE
# DEV: Due to the nature of Travis CI, we must use the `exec` backend for testing
# Additionally, since we need to execute some commands as root
# and since Serverspec doesn't support `sudo` invocations with the `exec`
# we need to install/invoke our test commands with `sudo`
# https://github.com/mizzy/specinfra/pull/509
before_install:
# Install bundler for the root user
- sudo gem install bundler
# Output OS information
- sudo ruby --version
- sudo bundle --version
install:
# Install repo specific dependencies
- sudo bundle install
script:
# If we want to provision the last tag, then provision it
- if test "$BOOTSTRAP_LAST_TAG" = "TRUE"; then bin/bootstrap-last-tag-travis-ci.sh; fi
# Run our provisioner
# DEV: Avoid using `sudo` for this line
# to guarantee provisioning can be done by a non-root user
- bin/bootstrap-travis-ci.sh
# Run Travis tests
- sudo bin/test-travis-ci.sh
# Only receive notifications on the start of a new branch and when it changes status
notifications:
email:
recipients:
- todd@twolfson.com
on_success: change
on_failure: change