revision 2.0.0 → 2.1.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: e319fb6dc51ae708782296c793f658547dd4a1e1f1df19e4fb2d3787213a22b8
4
- data.tar.gz: 9645d927126073825302fe097c719c6294af2a9ee97f4a72058040039f2beb00
3
+ metadata.gz: 9986acff4f8508220c70e554255da7faa2b5d3902469f48802edf4527cf3a5fe
4
+ data.tar.gz: 2fcb43d6ed4e766b13306b6b329c61c7f14653dc19da4f535c296438f6c99347
5
5
  SHA512:
6
- metadata.gz: 57bffb27f36a0a282c9555157402309069dceaabb403a2be7ae3bcacf4c17319b7a3646414087575e89bd1928876266282be9ca9aa89cf697e58d7d80b121dc8
7
- data.tar.gz: '094cd008804acc63b1f9732df488f59b5bed2e703928073c7b331c089854f00277317404eb127871ff01a67d58547153c311a9c7c5bb7520c51b9a4f0e1c6bcc'
6
+ metadata.gz: 79ae96751598c3e8db0623049cea440d940070f4e2793f57e9acf274475443beea2006d4ff551e1718bab7da010b7956589b6fa59a8bcfd0260e3e41ea4f0418
7
+ data.tar.gz: 2a999551ccfbf8db424366aee105a8dc9bf9c180934c5169a16063f5261e683b0c9a5083077244412367bea639895d46d6a355443cd62c74d69e211ca46dc3f8
data/.gitignore CHANGED
@@ -11,8 +11,10 @@
11
11
  .rspec_status
12
12
  Gemfile.lock
13
13
 
14
+ # exports / local build artefacts
14
15
  README.html
15
16
  *.zip
16
- test-output
17
17
  *.md5
18
+ *.sha512
19
+ test-output
18
20
  .direnv
@@ -248,6 +248,38 @@ module Revision
248
248
  end
249
249
  end
250
250
 
251
+ def deploy_to(d)
252
+ destination = File.expand_path(d[:dest])
253
+
254
+ if d.dig(:pre)
255
+ exec_pipeline('deploy (pre / #{d[:dest]})', d[:pre])
256
+ end
257
+
258
+ puts "Deploying #{artefacts.length} build artefacts to #{destination}..."
259
+ if not File.exist?(destination)
260
+ puts "... folder not found -> creating ... '#{destination}'"
261
+ FileUtils.mkdir_p(destination)
262
+ end
263
+ artefacts.each.with_index(1) do |a, idx|
264
+ # src, dest = entry
265
+ src = File.join(@root,a[:src])
266
+ dest = destination.empty? ? a[:dest] : File.join(destination, a[:dest])
267
+ puts "... (#{idx}/#{artefacts.length}) #{src} => #{dest}"
268
+ if File.exist?(dest)
269
+ puts "... deleting existing '#{dest}' ..."
270
+ FileUtils.rm_rf(dest)
271
+ end
272
+ puts "... deploying '#{src}' -> '#{dest}'"
273
+ FileUtils.cp_r(src,dest)
274
+ puts "... writing checksum for '#{dest}' to '#{Checksum.from_file(dest).write}'" if a[:chk]
275
+ end
276
+ File.open(File.join(destination,changelog_name),'w') { |f| output_changelog(f)}
277
+
278
+ if d.dig(:post)
279
+ exec_pipeline('deploy (post / #{d[:dest]})', d[:post])
280
+ end
281
+ end
282
+
251
283
  def deploy(destination='')
252
284
  destinations = []
253
285
  if not destination.empty?
@@ -263,34 +295,12 @@ module Revision
263
295
  raise Errors::NotSpecified.new(':deploy') if destinations.empty?
264
296
 
265
297
  destinations.each do |d|
266
- destination = File.expand_path(d[:dest])
267
-
268
- if d.dig(:pre)
269
- exec_pipeline('deploy (pre / #{d[:dest]})', d[:pre])
270
- end
271
-
272
- puts "Deploying #{artefacts.length} build artefacts to #{destination}..."
273
- if not File.exist?(destination)
274
- puts "... folder not found -> creating ... '#{destination}'"
275
- FileUtils.mkdir_p(destination)
276
- end
277
- artefacts.each.with_index(1) do |a, idx|
278
- # src, dest = entry
279
- src = File.join(@root,a[:src])
280
- dest = destination.empty? ? a[:dest] : File.join(destination, a[:dest])
281
- puts "... (#{idx}/#{artefacts.length}) #{src} => #{dest}"
282
- if File.exist?(dest)
283
- puts "... deleting existing '#{dest}' ..."
284
- FileUtils.rm_rf(dest)
285
- end
286
- puts "... deploying '#{src}' -> '#{dest}'"
287
- FileUtils.cp_r(src,dest)
288
- puts "... writing checksum for '#{dest}' to '#{Checksum.from_file(dest).write}'" if a[:chk]
289
- end
290
- File.open(File.join(destination,changelog_name),'w') { |f| output_changelog(f)}
291
-
292
- if d.dig(:post)
293
- exec_pipeline('deploy (post / #{d[:dest]})', d[:post])
298
+ if d.dig(:dest)
299
+ deploy_to(d)
300
+ elsif d.dig(:steps)
301
+ exec_pipeline("deploy", d[:steps])
302
+ else
303
+ puts "ERROR: Please specify a series of deployment :steps: or a :dest: in releasables.yaml"
294
304
  end
295
305
  end
296
306
 
@@ -1,10 +1,16 @@
1
1
  # Defines the revision ID for the revision gem
2
2
  module Revision
3
- VERSION = "2.0.0".freeze
3
+ VERSION = "2.1.0".freeze
4
4
  end
5
5
 
6
6
  # <BEGIN CHANGELOG>
7
7
  #
8
+ # Version 2.1.0 (16 Apr 2024)
9
+ # - feat(deploy): A deployment target can now be a series of commands rather than a filesystem destination
10
+ #
11
+ # Version 2.0.1 (30 Nov 2023)
12
+ # - deps(thor): Relaxed version dep from ~>1.0 to >=0.14
13
+ #
8
14
  # Version 2.0.0 (10 Nov 2023)
9
15
  # - new(checksum): Now using SHA512 rather than MD5 checksums
10
16
  #
data/releasables.yaml CHANGED
@@ -19,3 +19,7 @@
19
19
  :deploy:
20
20
  - :dest: ./test-output
21
21
  - :dest: ./test-output/2
22
+ # And check if the new (v2.0.2) deployment steps work....
23
+ - :steps:
24
+ - mkdir -p ./test-output/3
25
+ - touch ./test-output/3/bla.bla
data/revision.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_runtime_dependency 'thor', '~> 1.0'
24
+ spec.add_runtime_dependency 'thor', '>= 0.14'
25
25
  spec.add_runtime_dependency 'rubyzip', '~> 2.0'
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 2.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revision
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cormac Cannon
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '0.14'
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: '1.0'
26
+ version: '0.14'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubyzip
29
29
  requirement: !ruby/object:Gem::Requirement