devops_assist 0.3.8 → 0.3.11
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 +4 -0
- data/Gemfile.lock +3 -3
- data/devops_assist.gemspec +1 -1
- data/lib/devops_assist/gem/gem_utils.rb +2 -1
- data/lib/devops_assist/version.rb +1 -1
- data/tasks/devops_assist.rake +50 -42
- data/tasks/vcs.rake +25 -15
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baa4f3b3891cdbf45d1c4e2b95c3d515c9e6c0fa72ce01d66c2201b841638c75
|
4
|
+
data.tar.gz: 1d5279835de5d13f743d6c659d7d19dcce7ae3e3bafb0f8125be8cf128c21be1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 551d286841c46209940a868c645cdc5d403bccca54312a2349f16b42f97572e88c6bb6d73b6c15e13dee5af188a6c99af4983d2db90cd5108828372639477bcc
|
7
|
+
data.tar.gz: 882ef893631d5333a4c304f699d60233584699696e0507564829b9139ad09761bf3344976237a97e31d6fa466a23659db6c03d09e27e82290c73f3c03366f44d
|
data/.release_history.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
devops_assist (0.3.
|
4
|
+
devops_assist (0.3.11)
|
5
5
|
git_cli
|
6
|
-
git_cli_prompt
|
6
|
+
git_cli_prompt (~> 0.3.3)
|
7
7
|
gvcs
|
8
8
|
teLogger
|
9
9
|
toolrack
|
@@ -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.3)
|
23
23
|
teLogger
|
24
24
|
toolrack
|
25
25
|
tty-prompt
|
data/devops_assist.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
|
37
37
|
spec.add_dependency 'gvcs'
|
38
38
|
spec.add_dependency 'git_cli'
|
39
|
-
spec.add_dependency 'git_cli_prompt'
|
39
|
+
spec.add_dependency 'git_cli_prompt', "~> 0.3.3"
|
40
40
|
|
41
41
|
# Uncomment to register a new dependency of your gem
|
42
42
|
# spec.add_dependency "example-gem", "~> 1.0"
|
@@ -106,7 +106,8 @@ module DevopsAssist
|
|
106
106
|
cmd = "cd #{root} && gem push #{targetGem} -k #{selAcct}"
|
107
107
|
logger.tdebug :pubgemfile, "Command to publish gem : #{cmd}"
|
108
108
|
res = `#{cmd}`
|
109
|
-
|
109
|
+
#$stdin.gets while $stdin.ready? # to clear out any remaining input entry in the event publish operation failed
|
110
|
+
$stdin.iflush
|
110
111
|
[$?, res, targetGem]
|
111
112
|
else
|
112
113
|
raise GemError, "Given Gemfile '#{gemfile}' not found"
|
data/tasks/devops_assist.rake
CHANGED
@@ -37,6 +37,9 @@ namespace :devops do
|
|
37
37
|
gu = GemUtils.new(root)
|
38
38
|
begin
|
39
39
|
|
40
|
+
ws = Gvcs::Workspace.new(root)
|
41
|
+
raise DevopsAssist::Error, "Given path '#{root}' is not a git workspace" if not ws.is_workspace?
|
42
|
+
|
40
43
|
pmt = TTY::Prompt.new
|
41
44
|
|
42
45
|
# let's mark the session to allow automated context switching
|
@@ -67,7 +70,7 @@ namespace :devops do
|
|
67
70
|
miscFiles << selVerFile # version.rb
|
68
71
|
miscFiles << DevopsAssist::ReleaseLogger::LOG_NAME # release_history.yml
|
69
72
|
#miscFiles << 'Gemfile.lock'
|
70
|
-
Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
|
73
|
+
Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver, workspace: ws, pmt: pmt })
|
71
74
|
#pmt.say " Updated files during release prep have committed into version control", color: :yellow
|
72
75
|
|
73
76
|
|
@@ -80,49 +83,52 @@ namespace :devops do
|
|
80
83
|
pmt.say " Workspace check in done\n\n", color: :yellow
|
81
84
|
|
82
85
|
proceed = pmt.yes?(" Proceed to build the gem? ", color: :yellow)
|
83
|
-
raise GitCliPrompt::UserAborted if not proceed
|
84
|
-
|
85
|
-
|
86
|
-
# test build the gem, make sure there is no error
|
87
|
-
# If error expected the scripts stops here
|
88
|
-
Rake::Task["build"].execute
|
89
|
-
|
90
|
-
# Record the version number in the log files
|
91
|
-
# for reporting traceability
|
92
|
-
rl = DevopsAssist::ReleaseLogger.load
|
93
|
-
rl.log_release(gemName, ver)
|
94
|
-
#pmt.say " Release version number is logged after successful test built", color: :yellow
|
95
|
-
|
96
|
-
## If successfully built, following files shall be changed
|
97
|
-
#miscFiles = []
|
98
|
-
#miscFiles << selVerFile # version.rb
|
99
|
-
#miscFiles << DevopsAssist::ReleaseLogger::LOG_NAME # release_history.yml
|
100
|
-
#miscFiles << 'Gemfile.lock'
|
101
|
-
#Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
|
102
|
-
#pmt.say " Updated files during release prep have committed into version control", color: :yellow
|
103
|
-
|
104
|
-
## check in source code
|
105
|
-
#res = Rake::Task["devops:vcs:checkin_changes"].execute
|
106
|
-
#pmt.say " Workspace check in done\n", color: :yellow
|
107
|
-
|
108
|
-
#proceed = pmt.yes?(" Proceed with release? ")
|
109
86
|
#raise GitCliPrompt::UserAborted if not proceed
|
110
87
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
88
|
+
if proceed
|
89
|
+
|
90
|
+
# test build the gem, make sure there is no error
|
91
|
+
# If error expected the scripts stops here
|
92
|
+
Rake::Task["build"].execute
|
93
|
+
|
94
|
+
# Record the version number in the log files
|
95
|
+
# for reporting traceability
|
96
|
+
rl = DevopsAssist::ReleaseLogger.load
|
97
|
+
rl.log_release(gemName, ver)
|
98
|
+
#pmt.say " Release version number is logged after successful test built", color: :yellow
|
99
|
+
|
100
|
+
## If successfully built, following files shall be changed
|
101
|
+
#miscFiles = []
|
102
|
+
#miscFiles << selVerFile # version.rb
|
103
|
+
#miscFiles << DevopsAssist::ReleaseLogger::LOG_NAME # release_history.yml
|
104
|
+
#miscFiles << 'Gemfile.lock'
|
105
|
+
#Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
|
106
|
+
#pmt.say " Updated files during release prep have committed into version control", color: :yellow
|
107
|
+
|
108
|
+
## check in source code
|
109
|
+
#res = Rake::Task["devops:vcs:checkin_changes"].execute
|
110
|
+
#pmt.say " Workspace check in done\n", color: :yellow
|
111
|
+
|
112
|
+
#proceed = pmt.yes?(" Proceed with release? ")
|
113
|
+
#raise GitCliPrompt::UserAborted if not proceed
|
114
|
+
|
115
|
+
#
|
116
|
+
# Actual building the real gems build the gem
|
117
|
+
# Any possible reasons here error but not the one above?
|
118
|
+
#
|
119
|
+
# Main reason to do double build is to avoid to generate
|
120
|
+
# 2 log entries in Git for each build, which the 2nd (latest)
|
121
|
+
# log is just about the version updates (version pre 0.4.x way)
|
122
|
+
#
|
123
|
+
#Rake::Task["build"].execute
|
124
|
+
|
125
|
+
#rl.log_release(gemName, ver)
|
126
|
+
#pmt.say " Release version number is logged", color: :yellow
|
127
|
+
|
128
|
+
# publish gem
|
129
|
+
Rake::Task["devops:gem:publish_gem"].execute({ version: ver, pmt: pmt })
|
123
130
|
|
124
|
-
|
125
|
-
Rake::Task["devops:gem:publish_gem"].execute({ version: ver, pmt: pmt })
|
131
|
+
end
|
126
132
|
|
127
133
|
# following files shall change when gem is built
|
128
134
|
#miscFiles = []
|
@@ -132,7 +138,7 @@ namespace :devops do
|
|
132
138
|
#Rake::Task["devops:vcs:checkin_misc_files"].execute({ root: root, files: miscFiles, version: ver })
|
133
139
|
#pmt.say " Updated files during release prep have committed into version control", color: :yellow
|
134
140
|
|
135
|
-
Rake::Task["devops:vcs:tag_source_code"].execute({ root: root, version: ver })
|
141
|
+
Rake::Task["devops:vcs:tag_source_code"].execute({ root: root, version: ver, workspace: ws, pmt: pmt })
|
136
142
|
pmt.say " Source code is tagged as version #{ver}", color: :yellow
|
137
143
|
|
138
144
|
Rake::Task["devops:vcs:push_source_code"].execute({ root: root, pmt: pmt })
|
@@ -140,6 +146,8 @@ namespace :devops do
|
|
140
146
|
install = pmt.yes?(" Install the released gem to local environment? ")
|
141
147
|
if install
|
142
148
|
STDOUT.puts `gem install pkg/#{gemName}-#{ver}.gem`
|
149
|
+
else
|
150
|
+
pmt.say "\n\n Please run the gem install command manually : \n gem install pkg/#{gemName}-#{ver}.gem", color: :yellow
|
143
151
|
end
|
144
152
|
|
145
153
|
pmt.say " Gem #{gemName} version #{ver} released successfully ", color: :green
|
data/tasks/vcs.rake
CHANGED
@@ -21,13 +21,19 @@ namespace :devops do
|
|
21
21
|
root = args[:root]
|
22
22
|
files = args[:files]
|
23
23
|
ver = args[:version]
|
24
|
+
ws = args[:workspace]
|
25
|
+
pmt = args[:pmt]
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
+
begin
|
28
|
+
#ws = Gvcs::Workspace.new(root)
|
29
|
+
#if ws.is_workspace?
|
27
30
|
ws.add_to_staging(files)
|
28
31
|
ws.commit(" Committing file changed during release version '#{ver}'")
|
29
|
-
else
|
30
|
-
|
32
|
+
#else
|
33
|
+
# raise DevopsAssist::Error, " Given path '#{root}' is not a repository"
|
34
|
+
#end
|
35
|
+
rescue Exception => ex
|
36
|
+
pmt.say "\n Error during checking in misc files. Error waas : #{ex.message}", color: :red
|
31
37
|
end
|
32
38
|
|
33
39
|
end
|
@@ -37,14 +43,14 @@ namespace :devops do
|
|
37
43
|
|
38
44
|
root = args[:root]
|
39
45
|
ver = args[:version]
|
46
|
+
ws = args[:workspace]
|
47
|
+
pmt = args[:pmt]
|
40
48
|
|
41
|
-
|
42
|
-
|
43
|
-
ws = Gvcs::Workspace.new(root)
|
44
|
-
if ws.is_workspace?
|
49
|
+
begin
|
50
|
+
msg = pmt.ask(" Tagging message : ", default: "Automated tagging of source code release version #{ver} by DevOps Assist")
|
45
51
|
ws.create_tag(ver, msg)
|
46
|
-
|
47
|
-
|
52
|
+
rescue Exception => ex
|
53
|
+
pmt.say "\n Error while tagging source code. Error was : #{ex.message}"
|
48
54
|
end
|
49
55
|
|
50
56
|
end
|
@@ -55,12 +61,16 @@ namespace :devops do
|
|
55
61
|
root = args[:root]
|
56
62
|
pmt = args[:pmt]
|
57
63
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
64
|
+
begin
|
65
|
+
cli = DevopsAssist::Vcs::Git::CliPrompt.new
|
66
|
+
cli.push(root) do |ops, val|
|
67
|
+
case ops
|
68
|
+
when :push_info
|
69
|
+
pmt.say " Source code push to remote repository '#{val[:name]}'", color: :yellow
|
70
|
+
end
|
63
71
|
end
|
72
|
+
rescue Exception => ex
|
73
|
+
pmt.say "\n Error while pushing source code. Error was : #{ex.message}", color: :red
|
64
74
|
end
|
65
75
|
|
66
76
|
end
|
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.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Liaw
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toolrack
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: git_cli_prompt
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.3.3
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.3.3
|
97
97
|
description: ''
|
98
98
|
email:
|
99
99
|
- chrisliaw@antrapol.com
|
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
|
-
rubygems_version: 3.4.
|
142
|
+
rubygems_version: 3.4.10
|
143
143
|
signing_key:
|
144
144
|
specification_version: 4
|
145
145
|
summary: ''
|