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 +4 -4
- data/.gitignore +3 -1
- data/lib/revision/releasable.rb +38 -28
- data/lib/revision/version.rb +7 -1
- data/releasables.yaml +4 -0
- data/revision.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9986acff4f8508220c70e554255da7faa2b5d3902469f48802edf4527cf3a5fe
|
4
|
+
data.tar.gz: 2fcb43d6ed4e766b13306b6b329c61c7f14653dc19da4f535c296438f6c99347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79ae96751598c3e8db0623049cea440d940070f4e2793f57e9acf274475443beea2006d4ff551e1718bab7da010b7956589b6fa59a8bcfd0260e3e41ea4f0418
|
7
|
+
data.tar.gz: 2a999551ccfbf8db424366aee105a8dc9bf9c180934c5169a16063f5261e683b0c9a5083077244412367bea639895d46d6a355443cd62c74d69e211ca46dc3f8
|
data/.gitignore
CHANGED
data/lib/revision/releasable.rb
CHANGED
@@ -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
|
-
|
267
|
-
|
268
|
-
|
269
|
-
exec_pipeline(
|
270
|
-
|
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
|
|
data/lib/revision/version.rb
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
# Defines the revision ID for the revision gem
|
2
2
|
module Revision
|
3
|
-
VERSION = "2.
|
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
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', '
|
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.
|
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: '
|
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: '
|
26
|
+
version: '0.14'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubyzip
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|