revision 2.0.1 → 2.1.0

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: bbca11f977b41b9b983ee0aa3fb2dc1a9617098a275c991b78d19d90eca48ee6
4
- data.tar.gz: 46f8c0153fac4a040aaf67e1e73670e5deb3d338be770734c787a8941c5c89a6
3
+ metadata.gz: 9986acff4f8508220c70e554255da7faa2b5d3902469f48802edf4527cf3a5fe
4
+ data.tar.gz: 2fcb43d6ed4e766b13306b6b329c61c7f14653dc19da4f535c296438f6c99347
5
5
  SHA512:
6
- metadata.gz: 358518474ea83403e94ec3a0691bee2dfcd2e2b7fb080492a1fca0c28ddde6992390aa0096fd88a210659c25305b60a304623f255670d4279abfd722c461e758
7
- data.tar.gz: 287f6c4f9ae8d0e21e6fa82a2323268c1aafc1a2eef9710254b0df1331aa8080a68623bc7ecf937a49c4629e972ae2a7be806b556dec88b5827f9bee2043e51c
6
+ metadata.gz: 79ae96751598c3e8db0623049cea440d940070f4e2793f57e9acf274475443beea2006d4ff551e1718bab7da010b7956589b6fa59a8bcfd0260e3e41ea4f0418
7
+ data.tar.gz: 2a999551ccfbf8db424366aee105a8dc9bf9c180934c5169a16063f5261e683b0c9a5083077244412367bea639895d46d6a355443cd62c74d69e211ca46dc3f8
@@ -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,13 @@
1
1
  # Defines the revision ID for the revision gem
2
2
  module Revision
3
- VERSION = "2.0.1".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
+ #
8
11
  # Version 2.0.1 (30 Nov 2023)
9
12
  # - deps(thor): Relaxed version dep from ~>1.0 to >=0.14
10
13
  #
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
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.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cormac Cannon