-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
81 lines (67 loc) · 2.32 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
69
70
71
72
73
74
75
76
77
78
79
80
81
language: ruby
sudo: false
dist: trusty
rvm:
- 2.4.2
services:
- docker
before_install:
- echo "before_install"
install:
- echo "install"
- gem install bundler --no-rdoc --no-ri
- bundle install
before_script:
- echo 'before_script'
- export TF_VAR_region=us-west-2; export AWS_REGION=us-west-2
- wget https://releases.hashicorp.com/terraform/0.10.6/terraform_0.10.6_linux_amd64.zip
- unzip terraform_0.10.6_linux_amd64
- chmod +x terraform
- mkdir -p ${HOME}/bin
- export PATH=${PATH}:${HOME}/bin
- mv terraform ${HOME}/bin/
- rm -f terraform_*
- terraform -v
script:
- echo 'before_script'
# no terraform through docker until kitchen-terraform supports it
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light init
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light fmt -check=true
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light validate
- terraform init
- terraform fmt -check=true
- terraform validate
- docker run --rm -v $(pwd):/app/ --workdir=/app/ -t wata727/tflint --error-with-issues
- cd examples/test_fixtures
# this line is to change the source of the root module to 2 dirs back which works when validating in CI but when running through test kitchen, we need to source from 3 dirs up, oddly
- sed -i.bak 's/source = \"\.\.\//source = \"/g' main.tf
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light init
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light fmt -check=true
# - docker run -i -t -v $(pwd):/app/ -w /app/ hashicorp/terraform:light validate
- terraform init
- terraform fmt -check=true
- terraform validate
# FIXME: tflint is unhappy with sourcing a module from a relative dir here.
# - docker run --rm -v $(pwd):/data --workdir=/data -t wata727/tflint --error-with-issues
- mv main.tf.bak main.tf
- cd -
- terraform -v
- kitchen test --destroy always
# after_success:
# - echo 'foo'
# after_failure:
# - echo 'foo'
before_deploy:
# check if this is new release and conditionally continue?
- echo 'before_deploy phase'
deploy:
# likely want to publish to the registry
provider: script
script: ci/deploy.sh
on:
branch: dev
# after_deploy:
# notify of success/failure provide links
# - echo 'foo'
# after_script:
# - echo 'foo'