revision 1.2.7 → 1.3.1
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 +4 -4
- data/README.org +5 -0
- data/lib/revision/cli.rb +1 -1
- data/lib/revision/releasable.rb +51 -14
- data/lib/revision/version.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d52b5583cb4ae656d41eb5389156de53000fedd75980cda75e21b97ff9a81a4f
|
4
|
+
data.tar.gz: f2c5381a07f171f9d5bb45f09edf6465bc1a8666adaf293db0820a58282c2a49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 341c226a4413b6e43b49ecd073ee87431c989d209f27f3bbf5d2c0e871d9998c2fbb8f67d7cb2161260d379e74695694be0a055b9f23b8975f0d172da952ef44
|
7
|
+
data.tar.gz: f0aa801651600773e6764a51c88316920276d6ee9bf38d03351fcc534835a7d0bc167e97dcf5b8ac4c78b58234d04072f3dfe968007f8cef08693e501c42c69b
|
data/README.org
CHANGED
data/lib/revision/cli.rb
CHANGED
@@ -128,7 +128,7 @@ module Revision
|
|
128
128
|
if ask("Rebuild and archive any releasables (Y/n)?").upcase!='N'
|
129
129
|
r.package
|
130
130
|
end
|
131
|
-
if ask("Commit changes to existing files and add a Git tag (
|
131
|
+
if ask("Commit changes to existing files and add a Git tag (Y/n)?").upcase!='N'
|
132
132
|
r.tag
|
133
133
|
if ask("Push changes/tag to origin (Y/n)?").upcase=='N' || !r.push
|
134
134
|
say "To push from the command line, type 'git push --tags' at a shell prompt"
|
data/lib/revision/releasable.rb
CHANGED
@@ -88,6 +88,20 @@ module Revision
|
|
88
88
|
EOT
|
89
89
|
end
|
90
90
|
|
91
|
+
def exec_pipeline(type, steps, skip_steps=0)
|
92
|
+
exec_steps = steps[skip_steps..-1]
|
93
|
+
puts "{type} :: Executing steps #{skip_steps+1} to #{steps.length}..."
|
94
|
+
Dir.chdir(@root) do
|
95
|
+
exec_steps.each_with_index do |step, index|
|
96
|
+
step_index = index+1+skip_steps
|
97
|
+
puts "... (#{step_index}/#{steps.length}) #{step}"
|
98
|
+
system(step)
|
99
|
+
puts "{type} :: WARNING: step #{step_index}: #{step} exit status #{$?.exitstatus}" unless $?.exitstatus.zero?
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
104
|
+
|
91
105
|
def build(skip_steps = 0)
|
92
106
|
if @build_def.dig(:environment, :variables)
|
93
107
|
@build_def[:environment][:variables].each do |key, value|
|
@@ -105,16 +119,17 @@ module Revision
|
|
105
119
|
ENV[key] = value
|
106
120
|
end
|
107
121
|
end
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
end
|
122
|
+
exec_pipeline('build', @build_def[:steps], skip_steps)
|
123
|
+
# steps = @build_def[:steps][skip_steps..-1]
|
124
|
+
# puts "Executing #{steps.length} of #{@build_def[:steps].length} build steps..."
|
125
|
+
# Dir.chdir(@root) do
|
126
|
+
# steps.each_with_index do |step, index|
|
127
|
+
# step_index = index+1+skip_steps
|
128
|
+
# puts "... (#{step_index}/#{@build_def[:steps].length}) #{step}"
|
129
|
+
# system(step)
|
130
|
+
# puts "WARNING: build step #{step_index}: #{step} exit status #{$?.exitstatus}" unless $?.exitstatus.zero?
|
131
|
+
# end
|
132
|
+
# end
|
118
133
|
end
|
119
134
|
|
120
135
|
def tag_id
|
@@ -189,13 +204,22 @@ module Revision
|
|
189
204
|
File.delete(archive_name)
|
190
205
|
end
|
191
206
|
Zip::File.open(archive_name, Zip::File::CREATE) do |zipfile|
|
192
|
-
artefact_map.each
|
207
|
+
artefact_map.each do |src, dest|
|
208
|
+
#TODO: Add directory processing....
|
209
|
+
zipfile.add(dest,src)
|
210
|
+
end
|
193
211
|
puts "... embedding revision history as #{changelog_name} "
|
194
212
|
zipfile.get_output_stream(changelog_name) { |os| output_changelog(os)}
|
195
213
|
end
|
214
|
+
|
215
|
+
if @config.dig(:archive)
|
216
|
+
archive_root = File.expand_path(@config[:archive])
|
217
|
+
puts "... moving #{archive_name} to #{archive_root}"
|
218
|
+
FileUtils.mkdir_p(archive_root)
|
219
|
+
FileUtils.mv(archive_name, archive_root)
|
220
|
+
end
|
196
221
|
end
|
197
222
|
|
198
|
-
# def deploy(destination)
|
199
223
|
def deploy(destination='')
|
200
224
|
if destination=='' and @config.dig(:deploy, :dest)
|
201
225
|
destination = @config[:deploy][:dest]
|
@@ -204,9 +228,22 @@ module Revision
|
|
204
228
|
raise Errors::NotSpecified.new(':deploy/:dest') if destination==''
|
205
229
|
destination = File.expand_path(destination)
|
206
230
|
|
231
|
+
if @config.dig(:deploy, :pre)
|
232
|
+
exec_pipeline('deploy (pre)', @config[:deploy][:pre])
|
233
|
+
end
|
234
|
+
|
207
235
|
puts "Deploying #{@artefacts.length} build artefacts to #{destination}..."
|
208
|
-
artefact_map(destination).each
|
209
|
-
|
236
|
+
artefact_map(destination).each do |src, dest|
|
237
|
+
if File.exist?(dest)
|
238
|
+
puts "... deleting existing '#{dest}'"
|
239
|
+
FileUtils.rm_rf(dest)
|
240
|
+
end
|
241
|
+
FileUtils.cp_r(src,dest)
|
242
|
+
end
|
243
|
+
File.open(File.join(destination,changelog_name),'w') { |f| output_changelog(f)}
|
244
|
+
if @config.dig(:deploy, :post)
|
245
|
+
exec_pipeline('deploy (post)', @config[:deploy][:post])
|
246
|
+
end
|
210
247
|
end
|
211
248
|
|
212
249
|
def package
|
data/lib/revision/version.rb
CHANGED
@@ -1,10 +1,21 @@
|
|
1
1
|
# Defines the revision ID for the revision gem
|
2
2
|
module Revision
|
3
|
-
VERSION = "1.
|
3
|
+
VERSION = "1.3.1"
|
4
4
|
end
|
5
5
|
|
6
6
|
# <BEGIN CHANGELOG>
|
7
7
|
#
|
8
|
+
# Version 1.3.1 (20 May 2019)
|
9
|
+
# - Corrected bug when deploying changelog:w
|
10
|
+
#
|
11
|
+
# Version 1.3.0 (20 May 2019)
|
12
|
+
# - Added :archive: (archive root definition)
|
13
|
+
# - Added optional :pre: and :post: steps to :deploy: definition
|
14
|
+
#
|
15
|
+
# Version 1.2.8 (20 May 2019)
|
16
|
+
# - Updated Git tag/commit behaviour -- now commit/tag/push by default
|
17
|
+
# - Updated deploy to remove existing targets and copy entire directory trees
|
18
|
+
#
|
8
19
|
# Version 1.2.7 (17 May 2019)
|
9
20
|
# - 'deploy' now expands '~' in paths
|
10
21
|
#
|
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
|
+
version: 1.3.1
|
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-05-
|
11
|
+
date: 2019-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|