cloudspin-stack-rake 0.1.18 → 0.1.19

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: 8fd7e71574a680bb058b48cbae71eed41acc118d68eb964e6fd60701f19773f6
4
- data.tar.gz: 9f76039b22270373ffb3fc2bc9efd73a89a0a9bb5171b271dc94d23cc550c2bc
3
+ metadata.gz: 7aaf8bba7c93e42c6757fb7c856dab24706ad075e38874e20029e12bb6fafc95
4
+ data.tar.gz: 16b57b8e3febbf07a208b3ca20d816eb49e47a70deafc5cdc75e343a15c963a5
5
5
  SHA512:
6
- metadata.gz: a598546bfd6b2105fa0a64c5c5e7af0938dc4c603f8e1947fe59617dd7436c392dffa6260feafe8661cf7a1d279691a39da7b9f993674076429b2f45b9dd21c1
7
- data.tar.gz: 83f9e0413f3223f139867b7e4d3c5221dce2e6b0dcf68f06a8b12c9c0b6ee101d2cab6fd8b8f6a0fffb0c98dc42e79a6ebbbd058637fe311c99efe4537effaf0
6
+ metadata.gz: ba3dcdfedb69409afe5660d6506ff41ffb33cd99e1dcb2c616ec0269a694d9cf208cfed93fd7b6178bc34558319e7f74e3ab9482c978a2b40768b9b99182d111
7
+ data.tar.gz: 0d20b4bfb64f96963ae8ca1418e7f4f43627da0ad2aa1276e353ba15da22ca40dff22068d366a8775036d7e8f372c9a390bb834f9f6af9e7538acde21e34abd4
@@ -7,13 +7,11 @@ module Cloudspin
7
7
 
8
8
  attr_reader :environment
9
9
  attr_reader :stack_name
10
- attr_reader :definition_folder
11
10
  attr_reader :configuration_files
12
11
 
13
12
  def initialize(
14
13
  environment = nil,
15
14
  stack_name: 'instance',
16
- definition_folder: nil, # Should be deprecated
17
15
  definition_location: nil,
18
16
  base_folder: '.',
19
17
  configuration_files: nil
@@ -26,9 +24,6 @@ module Cloudspin
26
24
  # TODO: Pick this up from the configuration files?
27
25
  @definition_location = if definition_location
28
26
  definition_location
29
- elsif definition_folder
30
- puts "'definition_folder': is deprecated for Cloudspin::Stack::Rake::StackTask - use 'definition_location' instead"
31
- definition_folder
32
27
  else
33
28
  './src'
34
29
  end
@@ -135,70 +130,8 @@ module Cloudspin
135
130
  }
136
131
  end
137
132
 
138
- # TODO: This stuff belongs in a core class, so the CLI and other stuff can use it, too.
139
-
140
- def fetch_definition
141
- if /^http.*\.zip$/.match @definition_location
142
- puts "Downloading stack definition source from a remote zipfile"
143
- fetch_definition_zipfile
144
- elsif /^[\.\/]/.match @definition_location
145
- puts "Using local stack definition source"
146
- @definition_location
147
- else
148
- raise UnsupportedStackDefinitionLocationError, @definition_location
149
- end
150
- end
151
-
152
- def fetch_definition_zipfile
153
- unpack(download_artefact(@definition_location), '.cloudspin/definitions')
154
- end
155
-
156
- def download_artefact(artefact_url)
157
- download_dir = Dir.mktmpdir(['cloudspin-', '-download'])
158
- zipfile = "#{download_dir}/undetermined-spin-stack-artefact.zip"
159
- puts "Downloading artefact from #{artefact_url} to #{zipfile}"
160
- File.open(zipfile, 'wb') do |saved_file|
161
- open(artefact_url, 'rb') do |read_file|
162
- saved_file.write(read_file.read)
163
- end
164
- end
165
- zipfile
166
- end
167
-
168
- def unpack(zipfile, where_to_put_it)
169
- folder_name = path_of_source_in(zipfile)
170
- puts "Unzipping #{zipfile} to #{where_to_put_it}"
171
- Zip::File.open(zipfile) { |zip_file|
172
- zip_file.each { |f|
173
- puts "-> #{f.name}"
174
- f_path = File.join(where_to_put_it, f.name)
175
- FileUtils.mkdir_p(File.dirname(f_path))
176
- zip_file.extract(f, f_path) unless File.exist?(f_path)
177
- }
178
- }
179
- puts "Definition unpacked to #{where_to_put_it}/#{folder_name}"
180
- "#{where_to_put_it}/#{folder_name}"
181
- end
182
-
183
- def path_of_source_in(zipfile_path)
184
- File.dirname(path_of_configuration_file_in(zipfile_path))
185
- end
186
-
187
- def path_of_configuration_file_in(zipfile_path)
188
- zipfile = Zip::File.open(zipfile_path)
189
- begin
190
- zipfile.entries.select { |entry|
191
- /\/stack-definition.yaml$/.match entry.name
192
- }.first.name
193
- ensure
194
- zipfile.close
195
- end
196
- end
197
-
198
133
  end
199
134
 
200
- class UnsupportedStackDefinitionLocationError < StandardError; end
201
-
202
135
  end
203
136
  end
204
137
  end
@@ -1,7 +1,7 @@
1
1
  module Cloudspin
2
2
  module Stack
3
3
  module Rake
4
- VERSION = '0.1.18'
4
+ VERSION = '0.1.19'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudspin-stack-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'kief '
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-06 00:00:00.000000000 Z
11
+ date: 2018-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cloudspin-stack