TerraformDevKit 0.1.14 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a94f0642cf970c5994db6fc663a2f2add47810e4
4
- data.tar.gz: 8fa17cf1bf78f83abe26094616904692db12fdf2
3
+ metadata.gz: 3fdb3ffa0d6129a11bf2307a2e9016bbf82d779e
4
+ data.tar.gz: f3f531b2f14178df98c4463184ede09081b577bc
5
5
  SHA512:
6
- metadata.gz: daf674ba9d45403f922f157eccb704ac0581470c801c9d8c86d90b1c3dab5a3899993706931b42712b9994fe3b104d232b8ddb17d816184a887ff5f844ff3285
7
- data.tar.gz: 9171fd82c7de355a543053b1fd95bbd7f868ec2cb39547b4dec5faeb6510a820ec929e3931fec624683de7f8f924b694e767e44f20bb8c837708b0708bdbf64a
6
+ metadata.gz: f396925aa0ae75fe3687d94cc1c0266701e936880585f721cfaf5175c0e38787352f56d7f8bb958030b0bf79340ca884d5f4e9133c1033d659981def38610e8d
7
+ data.tar.gz: 47a6b8d4e74f95fb23c40a980325161641e7e6ac2dc64962dee09474a88baa52d46270562136d790ab46657fb946db7d548b1cdc2c3ded5ed6181238ee2f47d7
data/.appveyor.yml CHANGED
File without changes
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
- --format documentation
2
- --color
1
+ --format documentation
2
+ --color
data/.travis.yml CHANGED
@@ -1,8 +1,8 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.1.6
5
- before_install: gem install bundler -v 1.14.6
6
- os:
7
- - linux
8
- - osx
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.1.6
5
+ before_install: gem install bundler -v 1.14.6
6
+ os:
7
+ - linux
8
+ - osx
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in TerraformDevKit.gemspec
4
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in TerraformDevKit.gemspec
4
+ gemspec
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -1,200 +1,198 @@
1
- # TerraformDevKit
2
-
3
- [![Build Status](https://travis-ci.org/vistaprint/TerraformDevKit.svg?branch=master)](https://travis-ci.org/vistaprint/TerraformDevKit) [![Build status](https://ci.appveyor.com/api/projects/status/74s4yd7dmuwg5tmn/branch/master?svg=true)](https://ci.appveyor.com/project/Vistaprint/terraformdevkit/branch/master)
4
-
5
- Set of scripts to ease development and testing with [Terraform](https://www.terraform.io/).
6
-
7
- The script collection includes support for:
8
-
9
- * Managing AWS credentials
10
- * Backing up the state from a failed Terraform execution
11
- * Executing external commands
12
- * Simple configuration management
13
- * Simple reading and writing to AWS DynamoDB
14
- * Multiplatform tools
15
- * Making simple HTTP requests
16
- * Retrying a block of code
17
- * Terraform environment management
18
- * Locally installing Terraform and [Terragrunt](https://github.com/gruntwork-io/terragrunt)
19
- * Filtering Terraform logging messages
20
-
21
- Most of these scripts exist to provide support to a module development and testing environment for Terraform: [TerraformModules](https://github.com/vistaprint/TerraformModules). But, they might be useful for other purposes too.
22
-
23
- ## Installation
24
-
25
- Add this line to your application's Gemfile:
26
-
27
- ```ruby
28
- gem 'TerraformDevKit'
29
- ```
30
-
31
- And then execute:
32
-
33
- $ bundle
34
-
35
- Or install it yourself as:
36
-
37
- $ gem install TerraformDevKit
38
-
39
- ## Usage
40
-
41
- To use the library simply import it as:
42
-
43
- ```ruby
44
- require 'TerraformDevKit'
45
- ```
46
-
47
- ## Managing Terraform Environments
48
-
49
- TerraformDevKit provides a set of Rake tasks and Ruby scripts to ease the management of multiple Terraform environments. Three major environment types are supported: `dev`, `test` and `prod`.
50
-
51
- There might be many development environments (`dev`), each one with its own name. Development environments use a local Terraform backend. They are intented to be used by developers while adding features to the infrastructure.
52
-
53
- Testing (`test`) and production (`prod`) environment use a remote backend. Thus, the Terraform state file is not kept in the local disk, but on S3. This allows multiple developers to easily work on the same infrastructure instance. For safety reasons, operations that affect testing and production environments require manual user input. This is not the case for development environments.
54
-
55
- TerraformDevKit expects templated versions (using [Mustache](https://mustache.github.io/)) of the Terraform files. Such files might contain placeholders for several fields such as `Environment`, (AWS) `Region` or (AWS) `Profile`, among others. TerraformDevKit uses the template files to generate the final files that will be consumed by Terraform and Terragrunt. As an example, for the production environment, the resulting files are placed in a directory named `envs/prod`.
56
-
57
- ### Configuration Files
58
-
59
- Configuration files must be placed in a directory named `config`. Each environment type requires a different configuration file. Thus, the following three files must be placed in the `config` directory:
60
-
61
- * `config-dev.yml`
62
- * `config-test.yml`
63
- * `config-prod.yml`
64
-
65
- The first one contains the configuration for **all** the development environments that are created. The other two contain the configuration for the test and production environments, respectively.
66
-
67
- A sample configuration files is shown next:
68
-
69
- ```yaml
70
- terraform-version: 0.10.8
71
- terragrunt-version: 0.13.5
72
- aws:
73
- profile: myprofile
74
- region: eu-west-1
75
- ```
76
-
77
- The AWS profile **must not** be specified for test and production accounts, as users are required to manually type the profile name.
78
-
79
- ### A Minimal Rakefile
80
-
81
- ```ruby
82
- ROOT_PATH = File.dirname(File.expand_path(__FILE__))
83
-
84
- spec = Gem::Specification.find_by_name 'TerraformDevKit'
85
- load "#{spec.gem_dir}/tasks/devkit.rake"
86
-
87
- task :custom_test, [:env] do |_, args|
88
- # Add some tests here
89
- end
90
- ```
91
-
92
- ### Tasks and Hooks
93
-
94
- TerraformDevKit provides a set of generic tasks to perform:
95
-
96
- * `prepare`: prepares the environment
97
- * `plan`: shows the plan to create the infrastructure
98
- * `apply`: creates the infrastructure
99
- * `destroy`: destroys the infrastructure
100
- * `clean`: cleans the environment (after destroying the infrastructure)
101
- * `test`: tests a local environment
102
- * `preflight`: creates a temporary infrastructure and runs the test task
103
-
104
- Additionally, TerraformDevKit allows users to define a set of hooks that will be called during the different steps required to complete the previous list of tasks. The following hooks are available:
105
-
106
- * `pre_apply`: invoked before `apply` task runs
107
- * `post_apply`: invoked after `apply` task runs
108
- * `pre_destroy`: invoked before `destroy` task runs
109
- * `post_destroy`: invoked after `destroy` task runs
110
- * `custom_prepare`: invoked during the preparation process, before terraform is initialized
111
- * `custom_test`: invoked during as part of the `test` task, right after `apply` completes.
112
-
113
- ### Sample Terraform/Terragrunt Templates
114
-
115
- The following file (`main.tf.mustache`) contains the infrastructure configuration (a single S3 bucket) as well as information related to the AWS provider.
116
-
117
- ```hcl
118
- locals {
119
- env = "{{Environment}}"
120
- }
121
-
122
- terraform {
123
- backend {{#LocalBackend}}"local"{{/LocalBackend}}{{^LocalBackend}}"s3"{{/LocalBackend}} {}
124
- }
125
-
126
- provider "aws" {
127
- profile = "{{Profile}}"
128
- region = "{{Region}}"
129
- }
130
-
131
- resource "aws_s3_bucket" "raw" {
132
- bucket = "foo-${local.env}"
133
- acl = "private"
134
-
135
- {{#LocalBackend}}
136
- force_destroy = true
137
- {{/LocalBackend}}
138
- {{^LocalBackend}}
139
- lifecycle {
140
- prevent_destroy = true
141
- }
142
- {{/LocalBackend}}
143
- }
144
- ```
145
-
146
- An additional file (`terraform.tfvars.mustache`) contains the Terragrunt configuration. Terragrunt is used as it makes it easier to manage a remote backend. While Terraform is able to keep the state file in S3, it does not transparently create the DynamoDB lock table that prevents multiple developers from concurrently modifying the state file. Terragrunt, however, is able to do this without user intervention.
147
-
148
- ```hcl
149
- terragrunt = {
150
- remote_state {
151
- {{#LocalBackend}}
152
- backend = "local"
153
- config {}
154
- {{/LocalBackend}}
155
- {{^LocalBackend}}
156
- backend = "s3"
157
- config {
158
- bucket = "foo-remote-state"
159
- key = "foo-{{Environment}}.tfstate"
160
- lock_table = "foo-{{Environment}}-lock-table"
161
- encrypt = true
162
- profile = "{{Profile}}"
163
- region = "{{Region}}"
164
- }
165
- {{/LocalBackend}}
166
- }
167
- }
168
- ```
169
-
170
- ### Injecting Additional Variables into Template Files
171
-
172
- In addition to the default variables that are passed to Mustache when rendering a template file, users can provide additional variables. To do so, users must register a procedure that receives the environment as a parameter and returns a map with the extra variables and their values. An example is shown next:
173
-
174
- ```ruby
175
- TDK::TerraformConfigManager.register_extra_vars_proc(
176
- proc do
177
- { SumoLogicEndpoint: TDK::Configuration.get('sumologic')['endpoint'] }
178
- end
179
- )
180
- ```
181
-
182
- ### Updating Modules
183
-
184
- Terraform will get the necessary modules every time a new environment is created. Once the modules are cached, there is generally no need to keep updating the modules each time Terraform is executed. When using a module repository it is possible to select a specific version to use (as shown [here](https://www.terraform.io/docs/modules/sources.html#ref)). In such a case, Terraform will automatically update the modules whenever the version number is changed.
185
-
186
- When using local modules (e.g., during development process) it might be desirable to update the modules every time Terraform runs. This can be achieved by setting the environment variable `TF_DEVKIT_UPDATE_MODULES` to `true`.
187
-
188
- ## Development
189
-
190
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
191
-
192
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
193
-
194
- ## Contributing
195
-
196
- Bug reports and pull requests are welcome on GitHub at https://github.com/vistaprint/TerraformDevKit.
197
-
198
- ## License
199
-
200
- The gem is available as open source under the terms of the [Apache License, Version 2.0](https://opensource.org/licenses/Apache-2.0).
1
+ # TerraformDevKit
2
+
3
+ [![Build Status](https://travis-ci.org/vistaprint/TerraformDevKit.svg?branch=master)](https://travis-ci.org/vistaprint/TerraformDevKit) [![Build status](https://ci.appveyor.com/api/projects/status/74s4yd7dmuwg5tmn/branch/master?svg=true)](https://ci.appveyor.com/project/Vistaprint/terraformdevkit/branch/master)
4
+
5
+ Set of scripts to ease development and testing with [Terraform](https://www.terraform.io/).
6
+
7
+ The script collection includes support for:
8
+
9
+ * Managing AWS credentials
10
+ * Backing up the state from a failed Terraform execution
11
+ * Executing external commands
12
+ * Simple configuration management
13
+ * Simple reading and writing to AWS DynamoDB
14
+ * Multiplatform tools
15
+ * Making simple HTTP requests
16
+ * Retrying a block of code
17
+ * Terraform environment management
18
+ * Locally installing Terraform
19
+ * Filtering Terraform logging messages
20
+
21
+ Most of these scripts exist to provide support to a module development and testing environment for Terraform: [TerraformModules](https://github.com/vistaprint/TerraformModules). But, they might be useful for other purposes too.
22
+
23
+ ## Installation
24
+
25
+ Add this line to your application's Gemfile:
26
+
27
+ ```ruby
28
+ gem 'TerraformDevKit'
29
+ ```
30
+
31
+ And then execute:
32
+
33
+ $ bundle
34
+
35
+ Or install it yourself as:
36
+
37
+ $ gem install TerraformDevKit
38
+
39
+ ## Usage
40
+
41
+ To use the library simply import it as:
42
+
43
+ ```ruby
44
+ require 'TerraformDevKit'
45
+ ```
46
+
47
+ ## Managing Terraform Environments
48
+
49
+ TerraformDevKit provides a set of Rake tasks and Ruby scripts to ease the management of multiple Terraform environments. Three major environment types are supported: `dev`, `test` and `prod`.
50
+
51
+ There might be many development environments (`dev`), each one with its own name. Development environments use a local Terraform backend. They are intented to be used by developers while adding features to the infrastructure.
52
+
53
+ Testing (`test`) and production (`prod`) environment use a remote backend. Thus, the Terraform state file is not kept in the local disk, but on S3. This allows multiple developers to easily work on the same infrastructure instance. For safety reasons, operations that affect testing and production environments require manual user input. This is not the case for development environments.
54
+
55
+ TerraformDevKit expects templated versions (using [Mustache](https://mustache.github.io/)) of the Terraform files. Such files might contain placeholders for several fields such as `Environment`, (AWS) `Region` or (AWS) `Profile`, among others. TerraformDevKit uses the template files to generate the final files that will be consumed by Terraform. As an example, for the production environment, the resulting files are placed in a directory named `envs/prod`.
56
+
57
+ ### Configuration Files
58
+
59
+ Configuration files must be placed in a directory named `config`. Each environment type requires a different configuration file. Thus, the following three files must be placed in the `config` directory:
60
+
61
+ * `config-dev.yml`
62
+ * `config-test.yml`
63
+ * `config-prod.yml`
64
+
65
+ The first one contains the configuration for **all** the development environments that are created. The other two contain the configuration for the test and production environments, respectively.
66
+
67
+ A sample configuration files is shown next:
68
+
69
+ ```yaml
70
+ terraform-version: 0.11.0
71
+ project-name: my super cool project
72
+ aws:
73
+ profile: myprofile
74
+ region: eu-west-1
75
+ ```
76
+
77
+ The AWS profile **must not** be specified for test and production accounts, as users are required to manually type the profile name.
78
+
79
+ ### A Minimal Rakefile
80
+
81
+ ```ruby
82
+ ROOT_PATH = File.dirname(File.expand_path(__FILE__))
83
+
84
+ spec = Gem::Specification.find_by_name 'TerraformDevKit'
85
+ load "#{spec.gem_dir}/tasks/devkit.rake"
86
+
87
+ task :custom_test, [:env] do |_, args|
88
+ # Add some tests here
89
+ end
90
+ ```
91
+
92
+ ### Tasks and Hooks
93
+
94
+ TerraformDevKit provides a set of generic tasks to perform:
95
+
96
+ * `prepare`: prepares the environment
97
+ * `plan`: shows the plan to create the infrastructure
98
+ * `apply`: creates the infrastructure
99
+ * `destroy`: destroys the infrastructure
100
+ * `clean`: cleans the environment (after destroying the infrastructure)
101
+ * `test`: tests a local environment
102
+ * `preflight`: creates a temporary infrastructure and runs the test task
103
+
104
+ Additionally, TerraformDevKit allows users to define a set of hooks that will be called during the different steps required to complete the previous list of tasks. The following hooks are available:
105
+
106
+ * `pre_apply`: invoked before `apply` task runs
107
+ * `post_apply`: invoked after `apply` task runs
108
+ * `pre_destroy`: invoked before `destroy` task runs
109
+ * `post_destroy`: invoked after `destroy` task runs
110
+ * `custom_prepare`: invoked during the preparation process, before terraform is initialized
111
+ * `custom_test`: invoked during as part of the `test` task, right after `apply` completes.
112
+
113
+ ### Sample Terraform Templates
114
+
115
+ The following file (`main.tf.mustache`) contains the infrastructure configuration (a single S3 bucket) as well as information related to the AWS provider.
116
+
117
+ ```hcl
118
+ locals {
119
+ env = "{{Environment}}"
120
+ }
121
+
122
+ terraform {
123
+ backend {{#LocalBackend}}"local"{{/LocalBackend}}{{^LocalBackend}}"s3"{{/LocalBackend}} {}
124
+ }
125
+
126
+ provider "aws" {
127
+ profile = "{{Profile}}"
128
+ region = "{{Region}}"
129
+ }
130
+
131
+ resource "aws_s3_bucket" "raw" {
132
+ bucket = "foo-${local.env}"
133
+ acl = "private"
134
+
135
+ {{#LocalBackend}}
136
+ force_destroy = true
137
+ {{/LocalBackend}}
138
+ {{^LocalBackend}}
139
+ lifecycle {
140
+ prevent_destroy = true
141
+ }
142
+ {{/LocalBackend}}
143
+ }
144
+ ```
145
+
146
+ The config file requires a `project-name` to be set. This project name is then use to generate the S3 bucket and dynamodb lock table required by terraform to mamage remote state. To use the remote state feature of TerraformDevKit you must add the following section to your `main.tf.mustache` file:
147
+
148
+ ```hcl
149
+ terraform {
150
+ {
151
+ {{#LocalBackend}}
152
+ backend = "local" {}
153
+ {{/LocalBackend}}
154
+ {{^LocalBackend}}
155
+ backend = "s3" {
156
+ bucket = "{{ProjectName}}-{{Environment}}-state"
157
+ key = "{{ProjectAcronym}}-{{Environment}}.tfstate"
158
+ lock_table = "{{ProjectAcronym}}-{{Environment}}-lock-table"
159
+ encrypt = true
160
+ profile = "{{Profile}}"
161
+ region = "{{Region}}"
162
+ }
163
+ {{/LocalBackend}}
164
+ }
165
+ }
166
+ ```
167
+
168
+ ### Injecting Additional Variables into Template Files
169
+
170
+ In addition to the default variables that are passed to Mustache when rendering a template file, users can provide additional variables. To do so, users must register a procedure that receives the environment as a parameter and returns a map with the extra variables and their values. An example is shown next:
171
+
172
+ ```ruby
173
+ TDK::TerraformConfigManager.register_extra_vars_proc(
174
+ proc do
175
+ { SumoLogicEndpoint: TDK::Configuration.get('sumologic')['endpoint'] }
176
+ end
177
+ )
178
+ ```
179
+
180
+ ### Updating Modules
181
+
182
+ Terraform will get the necessary modules every time a new environment is created. Once the modules are cached, there is generally no need to keep updating the modules each time Terraform is executed. When using a module repository it is possible to select a specific version to use (as shown [here](https://www.terraform.io/docs/modules/sources.html#ref)). In such a case, Terraform will automatically update the modules whenever the version number is changed.
183
+
184
+ When using local modules (e.g., during development process) it might be desirable to update the modules every time Terraform runs. This can be achieved by setting the environment variable `TF_DEVKIT_UPDATE_MODULES` to `true`.
185
+
186
+ ## Development
187
+
188
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
189
+
190
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
191
+
192
+ ## Contributing
193
+
194
+ Bug reports and pull requests are welcome on GitHub at https://github.com/vistaprint/TerraformDevKit.
195
+
196
+ ## License
197
+
198
+ The gem is available as open source under the terms of the [Apache License, Version 2.0](https://opensource.org/licenses/Apache-2.0).
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -1,32 +1,33 @@
1
- # coding: utf-8
2
-
3
- lib = File.expand_path('../lib', __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'TerraformDevKit/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = 'TerraformDevKit'
9
- spec.version = TerraformDevKit::VERSION
10
- spec.authors = ['Victor Jimenez']
11
- spec.email = ['vjimenez@vistaprint.com']
12
-
13
- spec.summary = 'Set of scripts to ease development and testing with Terraform.'
14
- spec.homepage = 'https://github.com/vistaprint/TerraformDevKit'
15
- spec.license = 'Apache-2.0'
16
-
17
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
- f.match(%r{^(test|spec|features)/})
19
- end
20
- spec.bindir = 'exe'
21
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
- spec.require_paths = ['lib']
23
-
24
- spec.add_development_dependency 'bundler', '~> 1.14'
25
- spec.add_development_dependency 'rake', '~> 10.0'
26
- spec.add_development_dependency 'rspec', '~> 3.0'
27
- spec.add_development_dependency 'webmock', '~> 3.0.1'
28
-
29
- spec.add_runtime_dependency 'aws-sdk', '~> 2.9.37'
30
- spec.add_runtime_dependency 'mustache', '~> 1.0.2'
31
- spec.add_runtime_dependency 'rubyzip', '~> 1.2.1'
32
- end
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'TerraformDevKit/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'TerraformDevKit'
9
+ spec.version = TerraformDevKit::VERSION
10
+ spec.authors = ['Victor Jimenez']
11
+ spec.email = ['vjimenez@vistaprint.com']
12
+
13
+ spec.summary = 'Set of scripts to ease development and testing with Terraform.'
14
+ spec.homepage = 'https://github.com/vistaprint/TerraformDevKit'
15
+ spec.license = 'Apache-2.0'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = 'exe'
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ['lib']
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.14'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec', '~> 3.0'
27
+ spec.add_development_dependency 'webmock', '~> 3.0'
28
+
29
+ spec.add_runtime_dependency 'aws-sdk', '~> 2.9'
30
+ spec.add_runtime_dependency 'mustache', '~> 1.0'
31
+ spec.add_runtime_dependency 'rainbow', '~> 3.0'
32
+ spec.add_runtime_dependency 'rubyzip', '~> 1.2'
33
+ end
data/bin/console CHANGED
@@ -1,14 +1,14 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "TerraformDevKit"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "TerraformDevKit"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup CHANGED
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/wait_for_url CHANGED
File without changes
File without changes
@@ -1,18 +1,18 @@
1
- require 'fileutils'
2
-
3
- require_relative 'zip_file_generator'
4
-
5
- module TerraformDevKit
6
- class BackupState
7
- def self.backup(prefix)
8
- backup_path = ENV['TM_STATE_BACKUP_PATH']
9
- return if backup_path.nil?
10
-
11
- filename = "#{prefix}failure_state.zip"
12
- ZipFileGenerator.new('.', filename).write
13
-
14
- FileUtils.cp(filename, backup_path)
15
- puts "Copied state to #{File.join(backup_path, filename)}"
16
- end
17
- end
18
- end
1
+ require 'fileutils'
2
+
3
+ require_relative 'zip_file_generator'
4
+
5
+ module TerraformDevKit
6
+ class BackupState
7
+ def self.backup(prefix)
8
+ backup_path = ENV['TM_STATE_BACKUP_PATH']
9
+ return if backup_path.nil?
10
+
11
+ filename = "#{prefix}failure_state.zip"
12
+ ZipFileGenerator.new('.', filename).write
13
+
14
+ FileUtils.cp(filename, backup_path)
15
+ puts "Copied state to #{File.join(backup_path, filename)}"
16
+ end
17
+ end
18
+ end