File tree Expand file tree Collapse file tree 6 files changed +106
-15
lines changed
Expand file tree Collapse file tree 6 files changed +106
-15
lines changed Original file line number Diff line number Diff line change 1+ version : 2
2+
3+ common_steps : &common_steps
4+ - checkout
5+ - run :
6+ name : " Setup cache key"
7+ command : |
8+ echo $TF_VERSION > /tmp/tf_version
9+ - restore_cache :
10+ keys :
11+ - terraform-{{ checksum "/tmp/tf_version" }}
12+ # if this breaks later due to some updated ruby docker version we can deal with cache-busting scenarios then.
13+ - ruby-{{ checksum "/tmp/tf_version" }}-bundle
14+ - run :
15+ name : " Install terraform"
16+ command : |
17+ if [ ! -f "/tmp/terraform" ]; then
18+ wget -O "/tmp/tf.zip" https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip && unzip -o -d "/tmp/terraform" "/tmp/tf.zip"
19+ fi
20+ chmod +x /tmp/terraform/terraform
21+ sudo cp /tmp/terraform/terraform /usr/local/bin/
22+ - run :
23+ name : " Test: terraform version"
24+ command : terraform version
25+ - run :
26+ name : " Test: style check"
27+ command : " [ $(terraform fmt -write=false | wc -l) -eq 0 ]"
28+ - run :
29+ name : " Test: verify plan"
30+ command : |
31+ bundle install
32+
33+ if [ "$TF_LEGACY" != "true" ]; then
34+ for example in $(ls -d examples/*/); do
35+ pushd $example
36+ terraform init
37+ popd
38+ done
39+ fi
40+
41+ bundle exec rake
42+
43+ - save_cache :
44+ key : terraform-{{ checksum "/tmp/tf_version" }}
45+ paths :
46+ - /tmp/terraform
47+ - save_cache :
48+ key : ruby-{{ checksum "/tmp/tf_version" }}-bundle
49+ paths :
50+ - /usr/local/bundle
51+
52+ jobs :
53+ 0.8.8 :
54+ docker :
55+ - image : circleci/ruby
56+ environment :
57+ - TF_VERSION : 0.8.8
58+ - TF_LEGACY : true
59+ steps : *common_steps
60+ 0.9.11 :
61+ docker :
62+ - image : circleci/ruby
63+ environment :
64+ - TF_VERSION : 0.9.11
65+ - TF_LEGACY : true
66+ steps : *common_steps
67+ 0.10.7 :
68+ docker :
69+ - image : circleci/ruby
70+ environment :
71+ - TF_VERSION : 0.10.7
72+ steps : *common_steps
73+ 0.11.5 :
74+ docker :
75+ - image : circleci/ruby
76+ environment :
77+ - TF_VERSION : 0.11.5
78+ steps : *common_steps
79+
80+ workflows :
81+ version : 2
82+
83+ some_flow :
84+ jobs :
85+ - 0.8.8
86+ - 0.9.11
87+ - 0.10.7
88+ - 0.11.5
89+
90+
91+ # experimental:
92+ # notify:
93+ # branches:
94+ # only:
95+ # - master
Original file line number Diff line number Diff line change 11source "http://rubygems.org"
22
33gem "rake"
4+ gem "semantic" , "~> 1.6.1"
Original file line number Diff line number Diff line change 22 remote: http://rubygems.org/
33 specs:
44 rake (11.1.2 )
5+ semantic (1.6.1 )
56
67PLATFORMS
78 ruby
89
910DEPENDENCIES
1011 rake
12+ semantic (~> 1.6.1 )
1113
1214BUNDLED WITH
13- 1.11.2
15+ 1.12.5
Original file line number Diff line number Diff line change 11# Terraform AWS OpenVPN Module
2+
3+ [ ![ CircleCI] ( https://circleci.com/gh/unifio/terraform-aws-openvpn/tree/master.svg?style=svg )] ( https://circleci.com/gh/unifio/terraform-aws-openvpn/tree/master )
Original file line number Diff line number Diff line change 11require 'rake'
2+ require 'semantic'
23
34inputs = {
45 'stack_item_label' => 'expl-tst' ,
3435desc "Remove existing local state if present"
3536task :clean , [ :stack ] do |t , args |
3637 sh "cd examples/#{ args [ 'stack' ] } && rm -fr .terraform *.tfstate*"
38+ terraform_version = `terraform version` . split ( "\n " , 2 ) [ 0 ] . gsub ( 'Terraform v' , '' )
39+ if Semantic ::Version . new ( terraform_version ) >= Semantic ::Version . new ( "0.10.0" )
40+ sh "cd examples/#{ args [ 'stack' ] } && terraform init"
41+ end
3742end
3843
3944desc "Create execution plan"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments