devops_assist 0.3.3 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.release_history.yml +7 -1
- data/Gemfile +3 -2
- data/Gemfile.lock +3 -4
- data/lib/Rakefile +1 -0
- data/lib/devops_assist/gem/{gem.rb → gem_utils.rb} +44 -21
- data/lib/devops_assist/release_log/release_log.rb +1 -1
- data/lib/devops_assist/version.rb +2 -2
- data/lib/devops_assist/version_manager.rb +12 -12
- data/lib/devops_assist.rb +1 -18
- data/tasks/devops_assist.rake +81 -31
- data/tasks/gem.rake +28 -31
- data/tasks/vcs.rake +6 -1
- metadata +6 -7
- data/lib/devops_assist/gem/gemspec.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25dcd969f150b40b494562e4a2f4247fa93839857452687d84dce8727fdc12cf
|
4
|
+
data.tar.gz: 2ba0fc856e8dc5aacbaa63119a81f8d686321e6766fc1894ae2a1e7298ac3327
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d2102fef7458504a64dec4a66f776127d9d712d2507a005327bd4e27085da9638eb22d343b96035ef36e567067f782c2b9a3d04bae8174f5a73f9e0fcdef94d
|
7
|
+
data.tar.gz: 448b1b76f9f4faa3dc9e66096cd681b087dc3e74a590da0a557d0ef58acf7be10602cf6557831a09f4f9de07df8cec48bd24a74730df0b4f849011e31950d3d4
|
data/.release_history.yml
CHANGED
@@ -19,4 +19,10 @@ devops_assist:
|
|
19
19
|
- :version: 0.3.1
|
20
20
|
:timestamp: 1664976434.566908
|
21
21
|
- :version: 0.3.2
|
22
|
-
:timestamp:
|
22
|
+
:timestamp: 1679806218.9064217
|
23
|
+
- :version: 0.3.4
|
24
|
+
:timestamp: 1679814741.9125335
|
25
|
+
- :version: 0.3.4
|
26
|
+
:timestamp: 1679814912.2051551
|
27
|
+
- :version: 0.3.4
|
28
|
+
:timestamp: 1679814952.708086
|
data/Gemfile
CHANGED
@@ -9,7 +9,8 @@ gem "rake", "~> 13.0"
|
|
9
9
|
|
10
10
|
gem "rspec", "~> 3.0"
|
11
11
|
|
12
|
-
#gem "git_cli",
|
13
|
-
#gem "git_cli_prompt",
|
12
|
+
#gem "git_cli", path: '../../git/git_cli'
|
13
|
+
#gem "git_cli_prompt", path: '../../git/git_cli_prompt'
|
14
14
|
#
|
15
|
+
#gem 'toolrack', path: '../../WIP/toolrack'
|
15
16
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
devops_assist (0.3.
|
4
|
+
devops_assist (0.3.5)
|
5
5
|
git_cli
|
6
6
|
git_cli_prompt
|
7
7
|
gvcs
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
ptools (~> 1.4.0)
|
20
20
|
teLogger
|
21
21
|
toolrack
|
22
|
-
git_cli_prompt (0.3.
|
22
|
+
git_cli_prompt (0.3.2)
|
23
23
|
teLogger
|
24
24
|
toolrack
|
25
25
|
tty-prompt
|
@@ -42,7 +42,7 @@ GEM
|
|
42
42
|
rspec-support (~> 3.12.0)
|
43
43
|
rspec-support (3.12.0)
|
44
44
|
teLogger (0.2.2)
|
45
|
-
toolrack (0.20.
|
45
|
+
toolrack (0.20.2)
|
46
46
|
base58
|
47
47
|
tty-color (0.6.0)
|
48
48
|
tty-cursor (0.7.1)
|
@@ -57,7 +57,6 @@ GEM
|
|
57
57
|
wisper (2.0.1)
|
58
58
|
|
59
59
|
PLATFORMS
|
60
|
-
x86_64-darwin-21
|
61
60
|
x86_64-linux
|
62
61
|
|
63
62
|
DEPENDENCIES
|
data/lib/Rakefile
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
|
2
2
|
require 'yaml'
|
3
3
|
|
4
|
-
require_relative 'gemspec'
|
5
|
-
|
6
4
|
module DevopsAssist
|
7
|
-
|
5
|
+
class GemUtils
|
8
6
|
include TR::CondUtils
|
9
|
-
include Gemspec
|
10
7
|
|
11
|
-
class
|
8
|
+
class GemUtilsError < StandardError; end
|
9
|
+
|
10
|
+
def initialize(gemRoot)
|
11
|
+
@root = gemRoot
|
12
|
+
end
|
12
13
|
|
13
|
-
def update_gem_version(
|
14
|
+
def update_gem_version(newVersion, &block)
|
14
15
|
|
15
|
-
version_file = find_gem_version_file
|
16
|
+
version_file = find_gem_version_file
|
16
17
|
|
17
18
|
if version_file.length > 1
|
18
19
|
if block
|
@@ -25,7 +26,7 @@ module DevopsAssist
|
|
25
26
|
selVerFile = version_file.first
|
26
27
|
end
|
27
28
|
|
28
|
-
tmpFile = File.join(File.dirname(selVerFile),"version.
|
29
|
+
tmpFile = File.join(File.dirname(selVerFile),"version-da.bak")
|
29
30
|
FileUtils.mv(selVerFile,tmpFile)
|
30
31
|
|
31
32
|
File.open(selVerFile,"w") do |f|
|
@@ -40,22 +41,18 @@ module DevopsAssist
|
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
43
|
-
FileUtils.rm
|
44
|
+
FileUtils.rm(tmpFile)
|
44
45
|
|
45
46
|
selVerFile
|
46
47
|
|
47
48
|
end
|
48
49
|
|
49
|
-
def find_gem_version_file
|
50
|
-
if is_empty?(root)
|
51
|
-
|
52
|
-
else
|
53
|
-
Dir.glob(File.join(root,"**/version.rb"))
|
54
|
-
end
|
50
|
+
def find_gem_version_file
|
51
|
+
raise GemUtilsError, "Root path '#{@root}' to find_gem_version_file is empty" if is_empty?(@root)
|
52
|
+
Dir.glob(File.join(@root,"**/version.rb"))
|
55
53
|
end
|
56
54
|
|
57
|
-
|
58
|
-
def publish_gem(version, opts = { }, &block)
|
55
|
+
def self.publish_gem(version, opts = { }, &block)
|
59
56
|
|
60
57
|
cred = find_rubygems_api_key
|
61
58
|
|
@@ -90,7 +87,7 @@ module DevopsAssist
|
|
90
87
|
|
91
88
|
end
|
92
89
|
|
93
|
-
def publish_gem_file(gemfile, opts = { }, &block)
|
90
|
+
def self.publish_gem_file(gemfile, opts = { }, &block)
|
94
91
|
|
95
92
|
cred = find_rubygems_api_key
|
96
93
|
|
@@ -116,17 +113,43 @@ module DevopsAssist
|
|
116
113
|
|
117
114
|
end
|
118
115
|
|
116
|
+
def gem_name
|
117
|
+
gemspec.name
|
118
|
+
end
|
119
|
+
|
120
|
+
def gem_version_string
|
121
|
+
gem_version.version
|
122
|
+
end
|
123
|
+
|
124
|
+
def gem_version
|
125
|
+
gemspec.version
|
126
|
+
end
|
127
|
+
|
128
|
+
def gemspec
|
129
|
+
raise GemUtilsError, "Root path is not given" if is_empty?(@root)
|
130
|
+
|
131
|
+
if @_gemSpec.nil?
|
132
|
+
@_gemSpec = ::Gem::Specification.load(Dir.glob(File.join(@root,"*.gemspec")).first)
|
133
|
+
raise GemUtilsError, "Cannot find gemspec from #{@root}" if @_gemSpec.nil?
|
134
|
+
end
|
135
|
+
|
136
|
+
@_gemSpec
|
137
|
+
end
|
119
138
|
|
120
139
|
private
|
121
|
-
def logger
|
140
|
+
def self.logger
|
122
141
|
if @logger.nil?
|
123
142
|
@logger = TeLogger::Tlogger.new
|
124
|
-
@logger.tag = :
|
143
|
+
@logger.tag = :gem_utils
|
125
144
|
end
|
126
145
|
@logger
|
127
146
|
end
|
128
147
|
|
129
|
-
def
|
148
|
+
def logger
|
149
|
+
self.class.logger
|
150
|
+
end
|
151
|
+
|
152
|
+
def self.find_rubygems_api_key
|
130
153
|
if TR::RTUtils.on_windows?
|
131
154
|
credFile = File.join(ENV['USERPROFILE'],".gem","credentials")
|
132
155
|
else
|
@@ -23,7 +23,7 @@ module DevopsAssist
|
|
23
23
|
raise ReleaseLogError, "Release name cannot be empty" if is_empty?(relName)
|
24
24
|
raise ReleaseLogError, "Version cannot be empty" if is_empty?(version)
|
25
25
|
|
26
|
-
raise ReleaseLogError, "Version '#{version}' already in the log file for release '#{relName}'" if is_version_exist?(version, relName)
|
26
|
+
#raise ReleaseLogError, "Version '#{version}' already in the log file for release '#{relName}'" if is_version_exist?(version, relName)
|
27
27
|
|
28
28
|
rec = { version: version, timestamp: Time.now.to_f }
|
29
29
|
if block
|
@@ -3,12 +3,11 @@ require 'tty/prompt'
|
|
3
3
|
|
4
4
|
module DevopsAssist
|
5
5
|
module VersionManager
|
6
|
-
extend DevopsAssist::Gem
|
7
6
|
extend TR::VUtils
|
8
7
|
|
9
8
|
def self.prompt_version(gemName, last_version = "0.1.0")
|
10
9
|
|
11
|
-
begin
|
10
|
+
#begin
|
12
11
|
|
13
12
|
last_version = "0.1.0" if is_empty?(last_version)
|
14
13
|
|
@@ -16,15 +15,12 @@ module DevopsAssist
|
|
16
15
|
vers = possible_versions(last_version)
|
17
16
|
|
18
17
|
vv = []
|
19
|
-
|
20
18
|
vv << vers[2]
|
21
19
|
vv << vers[1]
|
22
20
|
vv << vers[0]
|
23
21
|
|
24
|
-
#
|
25
|
-
#
|
26
|
-
vv << "Custom"
|
27
|
-
vv << "Quit"
|
22
|
+
#vv << "Custom"
|
23
|
+
#vv << "Quit"
|
28
24
|
#vers << [ \
|
29
25
|
# "Maybe not now..." \
|
30
26
|
# ,"Nah, forget it..." \
|
@@ -35,20 +31,24 @@ module DevopsAssist
|
|
35
31
|
vv.each do |v|
|
36
32
|
menu.choice v
|
37
33
|
end
|
34
|
+
|
35
|
+
menu.choice "#{last_version} (current version - no change in version)", last_version
|
36
|
+
menu.choice "Custom version number", :custom
|
37
|
+
menu.choice "Abort", :abort
|
38
38
|
end
|
39
39
|
|
40
40
|
case vsel
|
41
|
-
when
|
41
|
+
when :custom
|
42
42
|
vsel = pmt.ask(" Please provide custom version no:", required: true)
|
43
|
-
when
|
43
|
+
when :abort
|
44
44
|
raise DevopsAssist::Error, " Aborted. Have a nice day! "
|
45
45
|
end
|
46
46
|
|
47
47
|
vsel
|
48
48
|
|
49
|
-
rescue TTY::Reader::InputInterrupt
|
50
|
-
|
51
|
-
end
|
49
|
+
#rescue TTY::Reader::InputInterrupt
|
50
|
+
# raise DevopsAssist::Error
|
51
|
+
#end
|
52
52
|
|
53
53
|
end
|
54
54
|
|
data/lib/devops_assist.rb
CHANGED
@@ -5,7 +5,7 @@ require_relative 'devops_assist/release_log/release_log'
|
|
5
5
|
|
6
6
|
require_relative 'devops_assist/vcs/git/cli_prompt'
|
7
7
|
|
8
|
-
require_relative 'devops_assist/gem/
|
8
|
+
require_relative 'devops_assist/gem/gem_utils'
|
9
9
|
|
10
10
|
require_relative 'devops_assist/version_manager'
|
11
11
|
|
@@ -19,23 +19,6 @@ module DevopsAssist
|
|
19
19
|
EnvKey = "DEVOPS_ASSIST"
|
20
20
|
EnvKeyGemReleasing = "#{EnvKey}_GEM_RELEASING"
|
21
21
|
|
22
|
-
def self.is_debug_mode?
|
23
|
-
val = ENV["DEVOPS_ASSIST_DEBUG"]
|
24
|
-
(not val.nil? and val.downcase == "true")
|
25
|
-
end
|
26
|
-
|
27
|
-
def self.debug(msg)
|
28
|
-
logger.tdebug(:devops_assist, msg) if is_debug_mode?
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
def logger
|
33
|
-
if @logger.nil?
|
34
|
-
@logger = TeLogger::TLogger.new(STDOUT)
|
35
|
-
end
|
36
|
-
@logger
|
37
|
-
end
|
38
|
-
|
39
22
|
end
|
40
23
|
|
41
24
|
# load the rake tasks
|
data/tasks/devops_assist.rake
CHANGED
@@ -3,43 +3,41 @@
|
|
3
3
|
require_relative '../lib/devops_assist'
|
4
4
|
require 'tty/prompt'
|
5
5
|
|
6
|
+
include DevopsAssist
|
7
|
+
|
6
8
|
namespace :devops do
|
7
9
|
|
8
|
-
desc "
|
9
|
-
task :
|
10
|
+
desc "Initialize the directory"
|
11
|
+
task :init do
|
10
12
|
|
11
|
-
|
12
|
-
STDOUT.puts "\n *********** DEBUG MODE ACTIVATED *************\n\n"
|
13
|
-
end
|
13
|
+
root = Dir.getwd
|
14
14
|
|
15
|
+
gu = GemUtils.new(root)
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "Release gem file project"
|
20
|
+
task :release do
|
21
|
+
|
22
|
+
root = Dir.getwd
|
23
|
+
gu = GemUtils.new(root)
|
15
24
|
begin
|
16
25
|
|
17
26
|
pmt = TTY::Prompt.new
|
18
27
|
|
19
|
-
root = Dir.getwd
|
20
|
-
|
21
28
|
# let's mark the session to allow automated context switching
|
22
29
|
ENV[DevopsAssist::EnvKeyGemReleasing] = "true"
|
23
30
|
|
24
|
-
gemName =
|
31
|
+
gemName = gu.gem_name
|
25
32
|
|
26
33
|
pmt.say " Starting gem release for gem #{gemName}", color: :yellow
|
27
34
|
|
28
|
-
|
29
|
-
#
|
30
|
-
|
31
|
-
pmt.say "
|
32
|
-
|
33
|
-
proceed = pmt.yes?(" Proceed with release? ")
|
34
|
-
raise GitCliPrompt::UserAborted if not proceed
|
35
|
-
|
36
|
-
rl = DevopsAssist::ReleaseLogger.load
|
37
|
-
|
38
|
-
# select version
|
39
|
-
ver = DevopsAssist::VersionManager.prompt_version(gemName, rl.last_version_number(gemName))
|
40
|
-
pmt.say " Version no. '#{ver}' chosen", color: :yellow
|
35
|
+
# select version
|
36
|
+
#ver = DevopsAssist::VersionManager.prompt_version(gemName, rl.last_version_number(gemName))
|
37
|
+
ver = DevopsAssist::VersionManager.prompt_version(gemName, gu.gem_version_string)
|
38
|
+
pmt.say " Version '#{ver}' is chosen", color: :yellow
|
41
39
|
|
42
|
-
selVerFile = update_gem_version(
|
40
|
+
selVerFile = gu.update_gem_version(ver) do |*args|
|
43
41
|
ops = args.first
|
44
42
|
case ops
|
45
43
|
when :select_version_file
|
@@ -50,33 +48,85 @@ namespace :devops do
|
|
50
48
|
end
|
51
49
|
pmt.say " Version file updated", color: :yellow
|
52
50
|
|
53
|
-
|
51
|
+
|
52
|
+
# check in source code
|
53
|
+
# Check in must be done 1st or else the 'gem build' process will fail
|
54
|
+
# because build will use git command. For any files that already deleted,
|
55
|
+
# the build will failed to find the files and throw exception
|
56
|
+
res = Rake::Task["devops:vcs:checkin_changes"].execute
|
57
|
+
pmt.say " Workspace check in done\n", color: :yellow
|
58
|
+
|
59
|
+
proceed = pmt.yes?(" Proceed to build the gem? ", color: :yellow)
|
60
|
+
raise GitCliPrompt::UserAborted if not proceed
|
61
|
+
|
62
|
+
|
63
|
+
# test build the gem, make sure there is no error
|
64
|
+
# If error expected the scripts stops here
|
54
65
|
Rake::Task["build"].execute
|
55
66
|
|
67
|
+
# Record the version number in the log files
|
68
|
+
# for reporting traceability
|
69
|
+
rl = DevopsAssist::ReleaseLogger.load
|
56
70
|
rl.log_release(gemName, ver)
|
57
|
-
pmt.say " Release version number is logged", color: :yellow
|
71
|
+
#pmt.say " Release version number is logged after successful test built", color: :yellow
|
72
|
+
|
73
|
+
## If successfully built, following files shall be changed
|
74
|
+
#miscFiles = []
|
75
|
+
#miscFiles << selVerFile # version.rb
|
76
|
+
#miscFiles << DevopsAssist::ReleaseLogger::LOG_NAME # release_history.yml
|
77
|
+
#miscFiles << 'Gemfile.lock'
|
78
|
+
#Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
|
79
|
+
#pmt.say " Updated files during release prep have committed into version control", color: :yellow
|
80
|
+
|
81
|
+
## check in source code
|
82
|
+
#res = Rake::Task["devops:vcs:checkin_changes"].execute
|
83
|
+
#pmt.say " Workspace check in done\n", color: :yellow
|
84
|
+
|
85
|
+
#proceed = pmt.yes?(" Proceed with release? ")
|
86
|
+
#raise GitCliPrompt::UserAborted if not proceed
|
87
|
+
|
88
|
+
#
|
89
|
+
# Actual building the real gems build the gem
|
90
|
+
# Any possible reasons here error but not the one above?
|
91
|
+
#
|
92
|
+
# Main reason to do double build is to avoid to generate
|
93
|
+
# 2 log entries in Git for each build, which the 2nd (latest)
|
94
|
+
# log is just about the version updates (version pre 0.4.x way)
|
95
|
+
#
|
96
|
+
#Rake::Task["build"].execute
|
97
|
+
|
98
|
+
#rl.log_release(gemName, ver)
|
99
|
+
#pmt.say " Release version number is logged", color: :yellow
|
58
100
|
|
59
101
|
# publish gem
|
60
102
|
Rake::Task["devops:gem:publish_gem"].execute({ version: ver, pmt: pmt })
|
61
103
|
|
62
104
|
# following files shall change when gem is built
|
63
|
-
miscFiles = []
|
64
|
-
miscFiles << selVerFile
|
65
|
-
miscFiles << DevopsAssist::ReleaseLogger::LOG_NAME
|
66
|
-
miscFiles << 'Gemfile.lock'
|
67
|
-
Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
|
68
|
-
pmt.say " Updated files during release prep have committed into version control", color: :yellow
|
105
|
+
#miscFiles = []
|
106
|
+
#miscFiles << selVerFile
|
107
|
+
#miscFiles << DevopsAssist::ReleaseLogger::LOG_NAME
|
108
|
+
#miscFiles << 'Gemfile.lock'
|
109
|
+
#Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
|
110
|
+
#pmt.say " Updated files during release prep have committed into version control", color: :yellow
|
69
111
|
|
70
112
|
Rake::Task["devops:vcs:tag_source_code"].execute({ root: root, version: ver })
|
71
113
|
pmt.say " Source code is tagged as version #{ver}", color: :yellow
|
72
114
|
|
73
115
|
Rake::Task["devops:vcs:push_source_code"].execute({ root: root, pmt: pmt })
|
74
116
|
|
117
|
+
install = pmt.yes?(" Install the released gem to local environment? ")
|
118
|
+
if install
|
119
|
+
STDOUT.puts `gem install pkg/#{gemName}-#{ver}.gem`
|
120
|
+
end
|
121
|
+
|
122
|
+
pmt.say " Gem #{gemName} version #{ver} released successfully ", color: :green
|
123
|
+
|
75
124
|
rescue GitCliPrompt::UserAborted, GitCliPrompt::UserChangedMind, TTY::Reader::InputInterrupt
|
125
|
+
STDOUT.puts
|
76
126
|
rescue Exception => ex
|
77
127
|
STDERR.puts ex.message
|
78
|
-
STDERR.puts ex.backtrace.join('\n') if DevopsAssist.is_debug_mode?
|
79
128
|
STDOUT.puts "\n\nAborted\n"
|
129
|
+
#STDERR.puts ex.backtrace.join('\n')
|
80
130
|
end
|
81
131
|
|
82
132
|
end
|
data/tasks/gem.rake
CHANGED
@@ -3,7 +3,7 @@ require_relative '../lib/devops_assist'
|
|
3
3
|
|
4
4
|
require 'tty/prompt'
|
5
5
|
|
6
|
-
include DevopsAssist::Gem
|
6
|
+
#include DevopsAssist::Gem
|
7
7
|
include TR::VUtils
|
8
8
|
|
9
9
|
namespace :devops do
|
@@ -14,7 +14,9 @@ namespace :devops do
|
|
14
14
|
|
15
15
|
root = Dir.getwd
|
16
16
|
|
17
|
-
|
17
|
+
gu = GemUtils.new(root)
|
18
|
+
|
19
|
+
selVerFile = gu.update_gem_version(args) do |*args|
|
18
20
|
ops = args.first
|
19
21
|
case ops
|
20
22
|
when :select_version_file
|
@@ -34,45 +36,40 @@ namespace :devops do
|
|
34
36
|
pmt = args[:pmt]
|
35
37
|
version = args[:version]
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
menu.choice k, k
|
49
|
-
end
|
50
|
-
|
51
|
-
menu.choice "Skip", :skip
|
52
|
-
menu.choice "Quit", :quit
|
53
|
-
|
39
|
+
ans = pmt.yes?(" Proceed to publish the gem to Rubygems?")
|
40
|
+
if ans
|
41
|
+
res, tg, out = GemUtils.publish_gem(version) do |*args|
|
42
|
+
ops = args.first
|
43
|
+
case ops
|
44
|
+
when :multiple_rubygems_account
|
45
|
+
acct = args[1]
|
46
|
+
selAct = pmt.select(" Please select one of the Rubygems credential to release:") do |menu|
|
47
|
+
|
48
|
+
acct.each do |k,v|
|
49
|
+
menu.choice k, k
|
54
50
|
end
|
55
51
|
|
56
|
-
|
52
|
+
menu.choice "Skip", :skip
|
53
|
+
menu.choice "Quit", :quit
|
57
54
|
|
58
|
-
selAct
|
59
55
|
end
|
56
|
+
|
57
|
+
raise DevopsAssist::Error, " Aborted. Have a nice day " if selAct == :quit
|
58
|
+
|
59
|
+
selAct
|
60
60
|
end
|
61
|
+
end
|
61
62
|
|
62
|
-
|
63
|
+
pmt.say(" Gem publishing is skipped", color: :yellow) if res == :skipped
|
63
64
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
65
|
+
if res.respond_to?(:success?)
|
66
|
+
if res.success?
|
67
|
+
pmt.say " Gem published!\n", color: :yellow
|
68
|
+
else
|
69
|
+
pmt.say " Gem publishing failed. Return message :\n#{out}", color: :red
|
70
70
|
end
|
71
|
-
|
72
71
|
end
|
73
72
|
|
74
|
-
rescue Exception => ex
|
75
|
-
pmt.error "Pushing to Rubygems failed. Error was : #{ex.message}\n\nPlease manually release to Rubygems"
|
76
73
|
end
|
77
74
|
|
78
75
|
end
|
data/tasks/vcs.rake
CHANGED
@@ -7,7 +7,12 @@ namespace :devops do
|
|
7
7
|
desc "Checking in changes of source code"
|
8
8
|
task :checkin_changes do
|
9
9
|
cli = DevopsAssist::Vcs::Git::CliPrompt.new
|
10
|
-
cli.commit(Dir.getwd)
|
10
|
+
cli.commit(Dir.getwd) do |ops|
|
11
|
+
case ops
|
12
|
+
when :raise_to_parent
|
13
|
+
true
|
14
|
+
end
|
15
|
+
end
|
11
16
|
end
|
12
17
|
|
13
18
|
desc "Checking in files generated by devops assist"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devops_assist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Liaw
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toolrack
|
@@ -112,8 +112,7 @@ files:
|
|
112
112
|
- devops_assist.gemspec
|
113
113
|
- lib/Rakefile
|
114
114
|
- lib/devops_assist.rb
|
115
|
-
- lib/devops_assist/gem/
|
116
|
-
- lib/devops_assist/gem/gemspec.rb
|
115
|
+
- lib/devops_assist/gem/gem_utils.rb
|
117
116
|
- lib/devops_assist/release_log/release_log.rb
|
118
117
|
- lib/devops_assist/vcs/git/cli_prompt.rb
|
119
118
|
- lib/devops_assist/vcs/vcs.rb
|
@@ -125,7 +124,7 @@ files:
|
|
125
124
|
homepage: ''
|
126
125
|
licenses: []
|
127
126
|
metadata: {}
|
128
|
-
post_install_message:
|
127
|
+
post_install_message:
|
129
128
|
rdoc_options: []
|
130
129
|
require_paths:
|
131
130
|
- lib
|
@@ -141,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
140
|
version: '0'
|
142
141
|
requirements: []
|
143
142
|
rubygems_version: 3.4.6
|
144
|
-
signing_key:
|
143
|
+
signing_key:
|
145
144
|
specification_version: 4
|
146
145
|
summary: ''
|
147
146
|
test_files: []
|
@@ -1,28 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module DevopsAssist
|
4
|
-
module Gem
|
5
|
-
module Gemspec
|
6
|
-
include TR::CondUtils
|
7
|
-
|
8
|
-
class GemspecError < StandardError; end
|
9
|
-
|
10
|
-
def find_gem_name(root)
|
11
|
-
spec = find_gemspec(root)
|
12
|
-
s = ::Gem::Specification.load(spec)
|
13
|
-
s.name
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
def find_gemspec(root)
|
18
|
-
if is_empty?(root)
|
19
|
-
raise GemspecError, "Root path '#{root}' to find_gemspec is empty"
|
20
|
-
else
|
21
|
-
Dir.glob(File.join(root,"*.gemspec")).first
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|