tflat 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +2 -0
- data/lib/tflat.rb +5 -0
- data/lib/tflat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 329791358e3d0b9aa452c4f36b81f1d885bff26a2da4a2e15c60df541bd36366
|
|
4
|
+
data.tar.gz: dde5a28faa85dd402d23aceca6b04940b08ba22a2b8ee8678b09883f6401f50f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bf5ac8ca188c97e235e5cdcb0edf48c5fae3562d307b154d1548012a932da1ee4e9072e4e5d222742952b94c617fc58577947cf3a0f2e4c13ba73e300643237
|
|
7
|
+
data.tar.gz: 4584ab627c91b6c99748856d8c931655c8f1d8c15204ad61db333cf223312de9575b7daa2bfa14e5668b4f3ee4461b5443dd3169d96779cb70d3d6ea6891fc1c
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.7 - Nov 17 2018
|
|
4
|
+
- Environment variables `TF_VAR_*` are also loaded by Ruby and will overwrite a value set in the JSON file.
|
|
5
|
+
|
|
3
6
|
## 0.1.6 - Nov 17 2018
|
|
4
7
|
- Folders or files with the character '#' on their names will be ignored. You can use that to comment several files at once by commenting their folder.
|
|
5
8
|
|
data/README.md
CHANGED
|
@@ -146,6 +146,8 @@ services:
|
|
|
146
146
|
|
|
147
147
|
That way you don't have to deal with Terraform templates!
|
|
148
148
|
|
|
149
|
+
**NOTE:** Environment variables like `TF_VAR_*` are also accessible in Ruby, and will take precedence if the same value is set in the JSON variables file.
|
|
150
|
+
|
|
149
151
|
## Ignoring certain folders
|
|
150
152
|
If you want TFlat to ignore a file or folder, just add a '#' to its name. This is useful when you want to destroy a chunk of infrastructure really quick, or when you don't want to apply something that you have been working on yet.
|
|
151
153
|
|
data/lib/tflat.rb
CHANGED
|
@@ -41,6 +41,11 @@ module Tflat
|
|
|
41
41
|
def read_variables
|
|
42
42
|
return unless File.file?('terraform.tfvars.json')
|
|
43
43
|
@variables = JSON.parse(File.read 'terraform.tfvars.json')
|
|
44
|
+
# Env vars TF_VAR_* will overwrite anything set on the JSON file.
|
|
45
|
+
ENV.select{|k,v| k =~ /^TF_VAR_.+$/}.each do |k,v|
|
|
46
|
+
name = k.sub('TF_VAR_', '')
|
|
47
|
+
@variables[name] = v
|
|
48
|
+
end
|
|
44
49
|
end
|
|
45
50
|
|
|
46
51
|
def flatten_directories
|
data/lib/tflat/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tflat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paulo Arruda
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-11-
|
|
11
|
+
date: 2018-11-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ptools
|