terraform-wrapper 1.0.3 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 303be04cdd5ed0531fef7b3c33a86f41f55c3a496224837bfdbcdaf6d1411ccc
4
- data.tar.gz: fe97c2265a13928c9c5893ac980e85d8123e5e55d8c0b80dc6306f3b4eee2d10
3
+ metadata.gz: 757e953e25e4899b35a17e556123581ab077a84769a144f51db286a6b56f8608
4
+ data.tar.gz: 25d70f9f0132157ccc738bf0c459f35d1e777f5760bae6177bc202e92bc1c95c
5
5
  SHA512:
6
- metadata.gz: 1b4d13a4e229ac1148083a4f234591bf253cf50096fc0c99273286b780017903a2660258619c00285e98dbad7bff3e2d83344ae7ace5ff86ebb836d164b3dc91
7
- data.tar.gz: d5cc2a92103f05b5ebc567e2dc2f75b35a9f3453277aef9953c90eed0da7643a78199e24357951fa7912f9770f29531a8f5bcb45b64f6a9c058ef27d1090c3c9
6
+ metadata.gz: a0399939f5522c2ffb3fcee4e0dded13c09b7731e0025de5d92bdab8afe63e9b3506eba6bf99d345323ea4f77f7a9096e18203f975127eb29729b60379036144
7
+ data.tar.gz: 9a8ef1ea51a121cd85a5a4334cda520f8a4246c2125510054c047f7d29e004cae8bf30a4eb200aae71321d0ccf1748b385449735d5e1bc00b65cf67b3f624c15
@@ -75,15 +75,28 @@ module TerraformWrapper
75
75
  logger.fatal("Invalid YAML in configuration file: #{@path}") unless yaml.kind_of?(Hash)
76
76
 
77
77
  identifiers = yaml.key?("identifiers") ? yaml["identifiers"] : Hash.new
78
- @variables = TerraformWrapper::Shared::Variables.new(config: @name, component: @code.name, service: @service, identifiers: identifiers)
79
- @variables.add_variables(variables: yaml["globals"]) if yaml.key?("globals")
78
+ @variables = TerraformWrapper::Shared::Variables.new(config: @name, component: @code.name, service: @service, identifiers: identifiers)
79
+
80
+ if yaml.key?("globals") then
81
+ logger.fatal("Key 'globals' is not a hash in configuration file: #{@path}") unless yaml["globals"].kind_of?(Hash)
82
+ globals = yaml["globals"]
83
+
84
+ @variables.add_variables(variables: globals["variables"]) if globals.key?("variables")
85
+ end
80
86
 
81
87
  if yaml.key?("terraform") then
82
88
  logger.fatal("Key 'terraform' is not a hash in configuration file: #{@path}") unless yaml["terraform"].kind_of?(Hash)
83
89
  terraform = yaml["terraform"]
84
90
 
85
- @variables.add_variables(variables: terraform["variables"]) if terraform.key?("variables")
86
- @variables.add_files(base: @base, files: terraform["files"]) if terraform.key?("files")
91
+ [ "globals", @code.name ].each do |extra|
92
+ if terraform.key?(extra) then
93
+ logger.fatal("Key '#{extra}' under 'terraform' is not a hash in configuration file: #{@path}") unless terraform[extra].kind_of?(Hash)
94
+ section = terraform[extra]
95
+
96
+ @variables.add_variables(variables: section["variables"]) if section.key?("variables")
97
+ @variables.add_files(base: @base, files: section["files"]) if section.key?("files")
98
+ end
99
+ end
87
100
  end
88
101
 
89
102
  @auths = Array.new
@@ -34,7 +34,7 @@ module TerraformWrapper
34
34
 
35
35
  def upgrade_task
36
36
  desc "Upgrades the Terraform infrastructure component modules, providers and lock file."
37
- task :upgrade => :binary do |t, args|
37
+ task :upgrade => [:binary, :clean] do |t, args|
38
38
  runner = TerraformWrapper::Shared::Runner.new(binary: @binary, code: @code)
39
39
 
40
40
  logger.info("Upgrading Terraform component: #{@code.name}...")
@@ -4,7 +4,7 @@ module TerraformWrapper
4
4
 
5
5
  ###############################################################################
6
6
 
7
- VERSION = "1.0.3"
7
+ VERSION = "1.1.0"
8
8
 
9
9
  ###############################################################################
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraform-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Lees
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-09 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake