forked from mantl/mantl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
43 lines (36 loc) · 1.63 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
language: python
sudo: required
services:
- docker
addons:
apt:
packages:
- unzip
branches:
only:
- master
env:
global:
- TF_VAR_build_number=${TRAVIS_JOB_NUMBER/./-}
- DOCKER_ARGS='-i -a stdout -a stderr -e TF_VAR_build_number -e CI_HEAD_COMMIT -e TRAVIS_COMMIT_RANGE -e TRAVIS_REPO_SLUG -e TRAVIS_BRANCH -e TRAVIS_PULL_REQUEST -e TERRAFORM_FILE -e DOCKER_SECRETS'
- DOCKER_IMAGE=siddharthist/mantl-testing:0.7.0-rc2
matrix:
# These providers have a full battery of Terraform+Ansible tests
- PROVIDER=aws DOCKER_SECRETS='-e AWS_SECRET_ACCESS_KEY -e AWS_ACCESS_KEY_ID'
- PROVIDER=do DOCKER_SECRETS='-e DIGITALOCEAN_TOKEN'
- PROVIDER=gce DOCKER_SECRETS='-e GOOGLE_CREDENTIALS'
# These providers are only linted using `terraform plan`, and have no secrets
# Secrets are available for CLC, but the build times out.
- PROVIDER=clc DOCKER_SECRETS='-e CLC_USERNAME -e CLC_PASSWORD'
- PROVIDER=softlayer
- PROVIDER=triton
before_script:
- export TERRAFORM_FILE=testing/terraform/${PROVIDER}.tf
- export CI_HEAD_COMMIT=$(git rev-list -n 1 --no-merges --branches="$(git rev-parse --abbrev-ref HEAD)" master...HEAD)
- echo $CI_HEAD_COMMIT
- docker pull $DOCKER_IMAGE
- docker run $DOCKER_ARGS -v $(pwd)/testing:/local -v $(pwd):/mantl $DOCKER_SECRETS $DOCKER_IMAGE "python2 docker.py ci-setup"
script:
- docker run $DOCKER_ARGS -v $(pwd)/testing:/local -v $(pwd):/mantl $DOCKER_SECRETS $DOCKER_IMAGE "python docker.py ci-build"
after_script:
- if [ -n "$DOCKER_SECRETS" ]; then docker run $DOCKER_ARGS -v $(pwd)/testing:/local -v $(pwd):/mantl $DOCKER_SECRETS $DOCKER_IMAGE "python docker.py ci-destroy"; fi