hygroscope 1.1.0 → 1.1.1

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
  SHA1:
3
- metadata.gz: 6cf0c838143e22c457350f92b2464989b275af06
4
- data.tar.gz: 16166f857257972e8ee90181d793a31bbebb9885
3
+ metadata.gz: 0d8b00db8a6e274402cc73b1db15a7250ec1733a
4
+ data.tar.gz: 3596dcf87638e808b78120d88ce0099cc19fc89d
5
5
  SHA512:
6
- metadata.gz: 91e264b2ecca6188a62bb028388c3e51e7a21a426e6bc1a9370f44c83464beb82483f81a5cbc52edddd6f52ddcf2a989d32e317f4d87ce9634a13ead72b803be
7
- data.tar.gz: d34c7c519cf094024ef5db03c5eed7e58be60bb330e2aad99f0adf037568961ce3965b78211ce7d4e7541c15731858f3c4dea19f5c2c03896290fdab7e69c5ba
6
+ metadata.gz: 7b068a17ed2bd8a1fae49b690a034991c4d3fa0be0a4fa4ebb5085a24261d68897c5bcb79d1a6488d668f3842e5dce8c5f566caad0e32857a1b39f9e88706d8a
7
+ data.tar.gz: 23d62cb6593737eaed96f793ee970029d70b2b542b1f64a32e63a0a2a44fcc9437d1d9d498004c6bea06b803befab6df93ee2cda4ff75e8b3ba3f78349b3ab59
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.1.1 (2015-02-04)
2
+
3
+ - Improved Payload parameters for more flexibility
4
+ - Fixed broken update action
5
+
1
6
  ## 1.1.0 (2015-02-03)
2
7
 
3
8
  - Support passing outputs from existing stacks into parameters.
data/hygroscope.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'hygroscope'
3
- s.version = '1.1.0'
3
+ s.version = '1.1.1'
4
4
  s.summary = 'CloudFormation launcher'
5
5
  s.description = 'A tool for managing the launch of complex CloudFormation stacks'
6
6
  s.authors = ['Daniel Silverman']
@@ -25,10 +25,6 @@ module Hygroscope
25
25
  end
26
26
  end
27
27
 
28
- def word_wrap(string, length = 80, delim = $INPUT_RECORD_SEPARATOR)
29
- string.scan(/.{#{length}}|.+/).map(&:strip).join(delim)
30
- end
31
-
32
28
  def countdown(text, time = 5)
33
29
  print "#{text} "
34
30
  time.downto(0) do |i|
@@ -66,40 +62,43 @@ module Hygroscope
66
62
  # If the paramset exists load it, otherwise instantiate an empty one
67
63
  p = Hygroscope::ParamSet.new(options[:paramset])
68
64
 
69
- # User provided a paramset, so load it and determine which parameters
70
- # are set and which need to be prompted.
71
65
  if options[:paramset]
72
- pkeys = p.parameters.keys
73
- tkeys = t.parameters.keys
74
-
75
- # Filter out any parameters that are not present in the template
76
- filtered = pkeys - tkeys
77
- pkeys = pkeys.select { |k, _v| tkeys.include?(k) }
78
- say_status('info', "Keys in paramset not requested by template: #{filtered.join(', ')}", :blue) unless filtered.empty?
79
-
80
- # If ask option was passed, consider every parameter missing
81
- missing = options[:ask] ? tkeys : tkeys - pkeys
66
+ # User provided a paramset, so load it and determine which parameters
67
+ # are set and which need to be prompted.
68
+ paramset_keys = p.parameters.keys
69
+ template_keys = t.parameters.keys
70
+
71
+ # Reject any keys in paramset that are not requested by template
72
+ rejected_keys = paramset_keys - template_keys
73
+ say_status('info', "Keys in paramset not requested by template: #{rejected_keys.join(', ')}", :blue) unless rejected_keys.empty?
74
+
75
+ # Prompt for any key that is missing. If "ask" option was passed,
76
+ # prompt for every key.
77
+ missing = options[:ask] ? template_keys : template_keys - paramset_keys
82
78
  else
83
79
  # No paramset provided, so every parameter is missing!
84
80
  missing = t.parameters.keys
85
81
  end
86
82
 
87
- # If an existing stack was specified, load its outputs
88
83
  if options[:existing]
84
+ # User specified an existing stack from which to pull outputs and
85
+ # translate into parameters. Load the existing stack.
89
86
  e = Hygroscope::Stack.new(options[:existing])
90
87
  say_status('info', "Populating parameters from #{options[:existing]} stack", :blue)
91
88
 
92
- # Fill any template paramater that matches an output of existing stack,
93
- # overriding parameters in the paramset. User can still change these if
94
- # they were missing from paramset or --ask option is passed.
89
+ # Fill any template parameter that matches an output from the existing
90
+ # stack, overwriting values from the paramset object. The user will
91
+ # be prompted to change these if they were not in the paramset or the
92
+ # --ask option was passed.
95
93
  e.describe.outputs.each do |o|
96
94
  p.set(o.output_key, o.output_value) if t.parameters.keys.include?(o.output_key)
97
95
  end
98
96
  end
99
97
 
100
- # Prompt for each missing param and save it to the paramset
98
+ # Prompt for each missing parameter and save it in the paramset object
101
99
  missing.each do |key|
102
- # Do not prompt for keys prefixed with "Hygroscope"
100
+ # Do not prompt for keys prefixed with the "Hygroscope" reserved word.
101
+ # These parameters are populated internally without user input.
103
102
  next if key =~ /^Hygroscope/
104
103
 
105
104
  type = t.parameters[key]['Type']
@@ -132,7 +131,7 @@ module Hygroscope
132
131
  # Offer to save paramset if it was modified
133
132
  # Filter out keys beginning with "Hygroscope" since they are not visible
134
133
  # to the user and may be modified on each invocation.
135
- unless missing.reject {|k| k =~ /^Hygroscope/}.empty?
134
+ unless missing.reject { |k| k =~ /^Hygroscope/ }.empty?
136
135
  if yes?('Save changes to paramset?')
137
136
  unless options[:paramset]
138
137
  p.name = ask('Paramset name', :cyan, default: options[:name])
@@ -146,14 +145,23 @@ module Hygroscope
146
145
  if File.directory?(payload_path)
147
146
  payload = Hygroscope::Payload.new(payload_path)
148
147
  payload.prefix = options[:name]
149
- url = payload.upload!
150
- signed_url = payload.generate_url
151
- p.set('HygroscopePayload', url) if missing.include?('HygroscopePayload')
152
- p.set('HygroscopePayloadSignedUrl', signed_url) if missing.include?('HygroscopePayloadSignedUrl')
148
+ payload.upload!
149
+ p.set('HygroscopePayloadBucket', payload.bucket) if missing.include?('HygroscopePayloadBucket')
150
+ p.set('HygroscopePayloadKey', payload.key) if missing.include?('HygroscopePayloadKey')
151
+ p.set('HygroscopePayloadSignedUrl', payload.generate_url) if missing.include?('HygroscopePayloadSignedUrl')
153
152
  say_status('ok', 'Payload uploaded to:', :green)
154
- say_status('', url)
153
+ say_status('', "s3://#{payload.bucket}/#{payload.key}")
155
154
  end
156
155
 
156
+ # Set some additional parameters, if present
157
+ # HygroscopeAccountAzList
158
+ # HygroscopeAccountAzCount
159
+ #if missing.include?('HygroscopeAccountAzList') ||
160
+ # misisng.include?('HygroscopeAccountAzCount')
161
+ # p.set('HygroscopeAccountAzList', azlist) if missing.include?('HygroscopeAccountAzList')
162
+ # p.set('HygroscopeAccountAzCount', azlist) if missing.include?('HygroscopeAccountAzCount')
163
+ #end
164
+
157
165
  [t, p]
158
166
  end
159
167
 
@@ -221,6 +229,7 @@ module Hygroscope
221
229
  s.parameters = paramset.parameters
222
230
  s.template = template.compress
223
231
  s.capabilities = ['CAPABILITY_IAM']
232
+ s.timeout = 60
224
233
  s.update!
225
234
 
226
235
  status
@@ -72,7 +72,7 @@ module Hygroscope
72
72
  stack_opts['capabilities'] = @capabilities unless @capabilities.empty?
73
73
 
74
74
  begin
75
- stack_id = @client.create_stack(stack_opts)
75
+ stack_id = @client.update_stack(stack_opts)
76
76
  rescue => e
77
77
  raise e
78
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hygroscope
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Silverman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-03 00:00:00.000000000 Z
11
+ date: 2015-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -163,9 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  requirements: []
165
165
  rubyforge_project:
166
- rubygems_version: 2.2.0
166
+ rubygems_version: 2.4.5
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: CloudFormation launcher
170
170
  test_files: []
171
- has_rdoc: