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 +4 -4
- data/CHANGELOG.md +5 -0
- data/hygroscope.gemspec +1 -1
- data/lib/hygroscope/cli.rb +37 -28
- data/lib/hygroscope/stack.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d8b00db8a6e274402cc73b1db15a7250ec1733a
|
4
|
+
data.tar.gz: 3596dcf87638e808b78120d88ce0099cc19fc89d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b068a17ed2bd8a1fae49b690a034991c4d3fa0be0a4fa4ebb5085a24261d68897c5bcb79d1a6488d668f3842e5dce8c5f566caad0e32857a1b39f9e88706d8a
|
7
|
+
data.tar.gz: 23d62cb6593737eaed96f793ee970029d70b2b542b1f64a32e63a0a2a44fcc9437d1d9d498004c6bea06b803befab6df93ee2cda4ff75e8b3ba3f78349b3ab59
|
data/CHANGELOG.md
CHANGED
data/hygroscope.gemspec
CHANGED
data/lib/hygroscope/cli.rb
CHANGED
@@ -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
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
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
|
93
|
-
#
|
94
|
-
# they were
|
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
|
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
|
-
|
150
|
-
|
151
|
-
p.set('
|
152
|
-
p.set('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('',
|
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
|
data/lib/hygroscope/stack.rb
CHANGED
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.
|
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-
|
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.
|
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:
|