stackit 0.1.13 → 0.1.14

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: 37957a0ab7a75459eea8abaa2069aacf28cf4add
4
- data.tar.gz: 516c9bd146cb7771de86751bd9aba7126582fcca
3
+ metadata.gz: 2377e14f70d1702952ef7978585e929fc40e3c78
4
+ data.tar.gz: 1a5f3f05d472161b4c935f8b5e19e395da6c4e39
5
5
  SHA512:
6
- metadata.gz: 0fc16655e92b18cbc1ff896b90dd9587e42e07bd711aa7020976d8b816f3acee6b9dccf227f8d8fbf598a7250fa405806408f9dbb1e9f0ebd83d376eeedb4c1c
7
- data.tar.gz: 9b51f7362a14c70c0901999588c3a1d715909a242e3da30beb4d382540ef2a72c180817613dce1b050ee0cd198daafb260466b5deb182961e243c619dc532e8a
6
+ metadata.gz: 1630a4ec8a5da72b513fa1036a05cda0a955f4953c6dc6be838c0abba3a386675d0304129b146ddd4f46f30214d64384b7714ed3b5134910760600fbe62d0ecf
7
+ data.tar.gz: be2b35681a4fe8ed567ffbdac24a3a266a3907bbadb569db500d8dae9b38e76d359ad53b47a86f0889f4f312ada1740b1ef3224f20e91a74b9c1c7bd0b1f0007
@@ -200,6 +200,7 @@ module Stackit
200
200
 
201
201
  def parse_file_parameters(parameters_file)
202
202
  if File.exist?(parameters_file)
203
+ Stackit.logger.info "Parsing cloudformation parameters file: #{parameters_file}"
203
204
  @file_parameters = {}
204
205
  file_params = JSON.parse(File.read(parameters_file))
205
206
  file_params.inject(@file_parameters) do |hash, param|
@@ -239,15 +240,16 @@ module Stackit
239
240
  def create_cloudformation_options(action)
240
241
  case action
241
242
  when :create_stack
242
- {
243
+ create_stack_request_params.merge(
243
244
  parameters: to_request_parameters(merged_parameters),
244
245
  capabilities: capabilities
245
- }.reverse_merge(template.options).reverse_merge(create_stack_request_params)
246
+ )
246
247
  when :update_stack
247
- {
248
+ update_stack_request_params.merge(
248
249
  parameters: to_request_parameters(merged_parameters),
249
- capabilities: capabilities
250
- }.merge(template.options).merge(update_stack_request_params)
250
+ capabilities: capabilities,
251
+ use_previous_template: template.options[:template_body].nil? && template.options[:template_url].nil?
252
+ )
251
253
  else
252
254
  delete_stack_request_params
253
255
  end
@@ -255,9 +257,8 @@ module Stackit
255
257
 
256
258
  def merged_parameters
257
259
  merged_params = template.parsed_parameters
258
- return parsed_parameters unless depends.length
259
260
  merged_params.merge!(file_parameters) if file_parameters
260
- depends.each do |dependent_stack_name|
261
+ depends.each do |dependent_stack_name|
261
262
  this_stack = Stack.new({
262
263
  cloudformation: cloudformation,
263
264
  stack_name: dependent_stack_name
@@ -48,15 +48,18 @@ module Stackit
48
48
  protected
49
49
 
50
50
  def stack_name
51
- return options[:stack_name] || "#{Stackit.environment}-#{options[:stack_name]}"
51
+ return options[:stack_name] ||
52
+ "#{Stackit.environment}-#{options[:stack_name]}"
52
53
  end
53
54
 
54
55
  def template
55
- return options[:template] || File.expand_path("#{options[:stack_name]}.json", template_dir)
56
+ return options[:template] ||
57
+ File.expand_path("#{options[:stack_name]}.json", template_dir)
56
58
  end
57
59
 
58
60
  def parameters_file
59
- return options[:parameters_file || File.expand_path("#{options[:stack_name]}.parameters", template_dir)
61
+ return options[:parameters_file] ||
62
+ File.expand_path("#{options[:stack_name]}.parameters", template_dir)
60
63
  end
61
64
 
62
65
  def parameter_mappings
data/lib/stackit/stack.rb CHANGED
@@ -32,7 +32,7 @@ module Stackit
32
32
  @capabilities = options[:capabilities]
33
33
  @tags = options[:tags]
34
34
  @on_failure = options[:on_failure]
35
- @use_previous_template = options[:use_previous_template] || true
35
+ @use_previous_template = options[:use_previous_template]
36
36
  @retain_resources = options[:retain_resources]
37
37
  end
38
38
 
@@ -1,3 +1,3 @@
1
1
  module Stackit
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Hahn