revision 1.4.1 → 1.5.0

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
  SHA256:
3
- metadata.gz: fdf646b4e8e2eb07bec9aab1ec7663998a5e3d6585f5b5be560d7b76383fa20b
4
- data.tar.gz: 47492a7855c38a50484e44b04e637258b1529e3fd6a437f3fc13e07c8ba83107
3
+ metadata.gz: 9e751f787a9d21911bbf12fcd96c26b5edecc896dd1b519e1e2a45107b9aa273
4
+ data.tar.gz: f1eeda41d66ccdcf5c98b4f913a6287bade0e477794920deb13c7458e4ffb3f0
5
5
  SHA512:
6
- metadata.gz: 950eee331752b94d3f2ef712f8f06883d104145169547314eded26556cd41b798be6af1bfdf9011b961751737175b317e19c729991f28b87ff3ed5f3163b8e45
7
- data.tar.gz: b25b45f4df9917a0c6064224a0e509ff002249524ce72ad43b5cf81d4d6bdadda07a8cb65e1eda6f075717b81a0b996631ac1ade59c0b031ebdf74c36e73233a
6
+ metadata.gz: fd8fe853c3c90625e7291a7f77b4e2489d17d7efeece980d7f8b808fd89d841418c7a632b2674d08e06bae395ac2f5d92876f7aa4b91e724763f9e0514e1b5bf
7
+ data.tar.gz: 239b26ff47f6166b81ac618310d64bc71835e97cdf95a9fdc56ca1296878014e7258024aaea9b5323e86f894293f8cdc363cd6c45ae123d881cee5617060f1af
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- #git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ # git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in revision.gemspec
6
6
  gemspec
@@ -95,7 +95,7 @@ module Revision
95
95
 
96
96
  def exec_pipeline(type, steps, skip_steps=0)
97
97
  exec_steps = steps[skip_steps..-1]
98
- puts "{type} :: Executing steps #{skip_steps+1} to #{steps.length}..."
98
+ puts "#{type} :: Executing steps #{skip_steps+1} to #{steps.length}..."
99
99
  Dir.chdir(@root) do
100
100
  exec_steps.each_with_index do |step, index|
101
101
  step_index = index+1+skip_steps
@@ -196,22 +196,23 @@ module Revision
196
196
  src = File.join(@root,src)
197
197
  dest = dest_prefix.empty? ? dest : File.join(dest_prefix, dest)
198
198
  amap[src] = dest
199
- puts "... (#{index+1}/#{@artefacts.length}) #{src} => #{dest}"
200
199
  end
201
200
  amap
202
201
  end
203
202
 
204
203
  def archive
205
204
  puts "Archiving #{@artefacts.length} build artefacts as #{archive_name}..."
206
- puts artefact_map
205
+ amap = artefact_map
207
206
  if File.exist?(archive_name)
208
207
  puts "... deleting existing archive"
209
208
  File.delete(archive_name)
210
209
  end
211
210
  Zip::File.open(archive_name, Zip::File::CREATE) do |zipfile|
212
- artefact_map.each do |src, dest|
211
+ amap.each.with_index(1) do |entry, idx|
212
+ src, dest = entry
213
213
  #TODO: Add directory processing....
214
- zipfile.add(dest,src)
214
+ puts "... (#{idx}/#{amap.length}) #{src} => #{dest}"
215
+ zipfile.add(dest, src)
215
216
  end
216
217
  puts "... embedding revision history as #{changelog_name} "
217
218
  zipfile.get_output_stream(changelog_name) { |os| output_changelog(os)}
@@ -226,26 +227,55 @@ module Revision
226
227
  end
227
228
 
228
229
  def deploy(destination='')
229
- if destination=='' and @config.dig(:deploy, :dest)
230
- destination = @config[:deploy][:dest]
230
+ destinations = []
231
+ if not destination.empty?
232
+ destinations.append({dest: destination})
233
+ elsif @config.dig(:deploy)
234
+ if @config[:deploy].kind_of?(Array)
235
+ destinations.append(*@config[:deploy])
236
+ else
237
+ destinations.append(@config[:deploy])
238
+ end
231
239
  end
232
240
 
233
- raise Errors::NotSpecified.new(':deploy/:dest') if destination==''
234
- destination = File.expand_path(destination)
241
+ raise Errors::NotSpecified.new(':deploy') if destinations.empty?
235
242
 
236
243
  if @config.dig(:deploy, :pre)
237
244
  exec_pipeline('deploy (pre)', @config[:deploy][:pre])
238
245
  end
239
246
 
240
- puts "Deploying #{@artefacts.length} build artefacts to #{destination}..."
241
- artefact_map(destination).each do |src, dest|
242
- if File.exist?(dest)
243
- puts "... deleting existing '#{dest}'"
244
- FileUtils.rm_rf(dest)
247
+ destinations.each do |d|
248
+ destination = File.expand_path(d[:dest])
249
+
250
+ if d.dig(:pre)
251
+ exec_pipeline('deploy (pre / #{d[:dest]})', d[:pre])
252
+ end
253
+
254
+ puts "Deploying #{@artefacts.length} build artefacts to #{destination}..."
255
+ if not File.exist?(destination)
256
+ puts "... folder not found -> creating ... '#{destination}'"
257
+ FileUtils.mkdir_p(destination)
258
+ end
259
+ amap = artefact_map(destination)
260
+ amap.each.with_index(1) do |entry, idx|
261
+ src, dest = entry
262
+ puts "... (#{idx}/#{amap.length}) #{src} => #{dest}"
263
+ if File.exist?(dest)
264
+ puts "... deleting existing '#{dest}' ..."
265
+ FileUtils.rm_rf(dest)
266
+ end
267
+ puts "... deploying '#{src}' -> '#{dest}"
268
+ FileUtils.cp_r(src,dest)
269
+ end
270
+ File.open(File.join(destination,changelog_name),'w') { |f| output_changelog(f)}
271
+
272
+ if d.dig(:post)
273
+ exec_pipeline('deploy (post / #{d[:dest]})', d[:post])
245
274
  end
246
- FileUtils.cp_r(src,dest)
247
275
  end
248
- File.open(File.join(destination,changelog_name),'w') { |f| output_changelog(f)}
276
+
277
+
278
+
249
279
  if @config.dig(:deploy, :post)
250
280
  exec_pipeline('deploy (post)', @config[:deploy][:post])
251
281
  end
@@ -1,10 +1,13 @@
1
1
  # Defines the revision ID for the revision gem
2
2
  module Revision
3
- VERSION = "1.4.1".freeze
3
+ VERSION = "1.5.0".freeze
4
4
  end
5
5
 
6
6
  # <BEGIN CHANGELOG>
7
7
  #
8
+ # Version 1.5.0 (13 Feb 2020)
9
+ # - Now handles multiple deployment destinations in releasables.yaml
10
+ #
8
11
  # Version 1.4.1 (18 Nov 2019)
9
12
  # - Updated to strip trailing whitespace after comment char for empty line
10
13
  #
data/revision.gemspec CHANGED
@@ -6,20 +6,12 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "revision"
7
7
  spec.version = Revision::VERSION
8
8
  spec.authors = ["Cormac Cannon"]
9
- spec.email = ["cormac.cannon@neuromoddevices.com"]
9
+ spec.licenses = ['MIT']
10
10
 
11
11
  spec.summary = %q{Language-agnostic revision management tool}
12
12
  spec.description = %q{Updates project revision identifiers in software source files and associated change log. Can also build and package project archives as a zip and optionally commit, tag and push to a Git repo.}
13
- # spec.homepage = "TBC"
14
-
15
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
16
- # to allow pushing to a single host or delete this section to allow pushing to any host.
17
- # if spec.respond_to?(:metadata)
18
- # spec.metadata["allowed_push_host"] = "http://gems.nmd.ie"
19
- # else
20
- # raise "RubyGems 2.0 or newer is required to protect against " \
21
- # "public gem pushes."
22
- # end
13
+ spec.homepage = 'https://rubygems.org/gems/revision'
14
+ spec.metadata = { "source_code_uri" => "https://github.com/cormacc/revision" }
23
15
 
24
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
17
  f.match(%r{^(test|spec|features)/})
@@ -29,11 +21,11 @@ Gem::Specification.new do |spec|
29
21
 
30
22
  spec.require_paths = ["lib"]
31
23
 
32
- spec.add_runtime_dependency 'thor', '~> 0.19.1'
33
- spec.add_runtime_dependency 'rubyzip'
24
+ spec.add_runtime_dependency 'thor', '~> 1.0'
25
+ spec.add_runtime_dependency 'rubyzip', '~> 2.0'
34
26
 
35
27
  spec.add_development_dependency "bundler", "~> 2.0"
36
- spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "rake", "~> 13.0"
37
29
  spec.add_development_dependency "rspec", "~> 3.0"
38
30
  spec.add_development_dependency "pry"
39
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revision
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cormac Cannon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-18 00:00:00.000000000 Z
11
+ date: 2020-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.19.1
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.19.1
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -97,8 +97,7 @@ dependencies:
97
97
  description: Updates project revision identifiers in software source files and associated
98
98
  change log. Can also build and package project archives as a zip and optionally
99
99
  commit, tag and push to a Git repo.
100
- email:
101
- - cormac.cannon@neuromoddevices.com
100
+ email:
102
101
  executables:
103
102
  - revision
104
103
  extensions: []
@@ -123,9 +122,11 @@ files:
123
122
  - lib/revision/version.rb
124
123
  - releasables.yaml
125
124
  - revision.gemspec
126
- homepage:
127
- licenses: []
128
- metadata: {}
125
+ homepage: https://rubygems.org/gems/revision
126
+ licenses:
127
+ - MIT
128
+ metadata:
129
+ source_code_uri: https://github.com/cormacc/revision
129
130
  post_install_message:
130
131
  rdoc_options: []
131
132
  require_paths:
@@ -141,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
142
  - !ruby/object:Gem::Version
142
143
  version: '0'
143
144
  requirements: []
144
- rubygems_version: 3.0.6
145
+ rubygems_version: 3.1.2
145
146
  signing_key:
146
147
  specification_version: 4
147
148
  summary: Language-agnostic revision management tool