-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
40 lines (32 loc) · 1.04 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
sudo: required
language: bash
services:
- docker
env:
global:
- GO_CACHE=$HOME/.go
- DOCKER_TAG=lukeelten/openshift-aws
- TERRAFORM_DIR=/opt/terraform
cache:
directories:
- $GO_CACHE
- $TERRAFORM_DIR
before_install:
- if [[ ! -f $TERRAFORM_DIR/terraform ]]; then curl -fSL "https://releases.hashicorp.com/terraform/0.11.7/terraform_0.11.7_linux_amd64.zip" -o terraform.zip && sudo unzip terraform.zip -d $TERRAFORM_DIR; fi
- sudo ln -s /opt/terraform/terraform /usr/bin/terraform
install:
- docker pull golang:1
- ( cd terraform && terraform init )
script:
# Terraform Validation
- ( cd terraform && terraform validate -var-file=terraform.test.json )
# Run Go Unit Tests
- docker run --rm -v "$GO_CACHE":/go -v "$PWD/orchestration":/app -w /app golang:1 make test
# Build application
- docker run --rm -v "$GO_CACHE":/go -v "$PWD/orchestration":/app -w /app -e HOST_UID="$UID" golang:1 make
# Build docker image
- docker build --pull -t $DOCKER_TAG .
notifications:
email:
on_success: never
on_failure: change