devops_assist 0.2.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebdaf870d19aabb7f4090b013bc6b470504d09362a02882d25409be9c0aa0934
4
- data.tar.gz: 47c4a2020605840ec5b38ee040a77a7d86cc9708404332292314d28d2d8d6dbb
3
+ metadata.gz: a94fff44947bd07b1d4c7910725c8fce1087f59d8fa3b4def053247c25bebb45
4
+ data.tar.gz: 309bcac9863e931d30dc81bea711bdae626c92c2824a03f468e41083dcf702aa
5
5
  SHA512:
6
- metadata.gz: 870d8999ad101743581295ac9cc0fbcf02f9ef40cb169dc178dbfa53f33095fc9f77064cc9a31832d65ea0506b8359d4745e11a42be595552331b571d9e34d9b
7
- data.tar.gz: 5d350ea750ebd164a163922c1905c69c6b7b6a4f0c88b8f08536b11152910cdf3b81e52448b85cb925f0a63957197377b48a6c4ba56ae36af928b52fc1e4d551
6
+ metadata.gz: e8be68bcaaa7588f487f1eaad1e6961feba147b12f4646373ca27552ce7ab6d2a8713475b86e2fd43475e4b6afb9e868d28f94f3e5855629b66e5da7fdf15a8a
7
+ data.tar.gz: 3b621c532af465206a6833fadcfe5a8fd7b759f627b74102868e7d584ea3296a44cec0b13d240933187478dd182342db836b48557d42071fe0af018e50eddf75
data/.release_history.yml CHANGED
@@ -12,3 +12,11 @@ devops_assist:
12
12
  :timestamp: 1637846341.0877914
13
13
  - :version: 0.2.0
14
14
  :timestamp: 1657610885.1882625
15
+ - :version: 0.2.1
16
+ :timestamp: 1660213921.2263613
17
+ - :version: 0.3.0
18
+ :timestamp: 1661973921.357578
19
+ - :version: 0.3.1
20
+ :timestamp: 1664976434.566908
21
+ - :version: 0.3.2
22
+ :timestamp: 1679541322.329349
data/Gemfile CHANGED
@@ -9,8 +9,7 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
- #gem "git_cli", path: '../../git/git_cli'
13
- #gem "git_cli_prompt", path: '../../git/git_cli_prompt'
12
+ #gem "git_cli", git: "git_cli", branch: "master"
13
+ #gem "git_cli_prompt", git: "git_cli_prompt", branch: "master"
14
14
  #
15
- #gem 'toolrack', path: '../../WIP/toolrack'
16
15
 
data/Gemfile.lock CHANGED
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devops_assist (0.1.3)
4
+ devops_assist (0.3.3)
5
5
  git_cli
6
6
  git_cli_prompt
7
7
  gvcs
8
- tlogger
8
+ teLogger
9
9
  toolrack
10
10
  tty-prompt
11
11
 
@@ -13,38 +13,37 @@ GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
15
  base58 (0.2.3)
16
- diff-lcs (1.4.4)
17
- git_cli (0.9.0)
16
+ diff-lcs (1.5.0)
17
+ git_cli (0.11.2)
18
18
  gvcs
19
19
  ptools (~> 1.4.0)
20
- tlogger
20
+ teLogger
21
21
  toolrack
22
- git_cli_prompt (0.2.2)
23
- tlogger
22
+ git_cli_prompt (0.3.1)
23
+ teLogger
24
24
  toolrack
25
25
  tty-prompt
26
- gvcs (0.1.0)
26
+ gvcs (0.1.1)
27
27
  pastel (0.8.0)
28
28
  tty-color (~> 0.5)
29
- ptools (1.4.2)
29
+ ptools (1.4.3)
30
30
  rake (13.0.6)
31
- rspec (3.10.0)
32
- rspec-core (~> 3.10.0)
33
- rspec-expectations (~> 3.10.0)
34
- rspec-mocks (~> 3.10.0)
35
- rspec-core (3.10.1)
36
- rspec-support (~> 3.10.0)
37
- rspec-expectations (3.10.1)
31
+ rspec (3.12.0)
32
+ rspec-core (~> 3.12.0)
33
+ rspec-expectations (~> 3.12.0)
34
+ rspec-mocks (~> 3.12.0)
35
+ rspec-core (3.12.1)
36
+ rspec-support (~> 3.12.0)
37
+ rspec-expectations (3.12.2)
38
38
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.10.0)
40
- rspec-mocks (3.10.2)
39
+ rspec-support (~> 3.12.0)
40
+ rspec-mocks (3.12.4)
41
41
  diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.10.0)
43
- rspec-support (3.10.3)
44
- tlogger (0.26.3)
45
- toolrack (0.17.0)
42
+ rspec-support (~> 3.12.0)
43
+ rspec-support (3.12.0)
44
+ teLogger (0.2.2)
45
+ toolrack (0.20.1)
46
46
  base58
47
- tlogger
48
47
  tty-color (0.6.0)
49
48
  tty-cursor (0.7.1)
50
49
  tty-prompt (0.23.1)
@@ -58,6 +57,7 @@ GEM
58
57
  wisper (2.0.1)
59
58
 
60
59
  PLATFORMS
60
+ x86_64-darwin-21
61
61
  x86_64-linux
62
62
 
63
63
  DEPENDENCIES
data/Rakefile CHANGED
@@ -5,6 +5,7 @@ require "rspec/core/rake_task"
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- require_relative './lib/devops_assist'
8
+ #require_relative './lib/devops_assist'
9
+ require File.join(File.dirname(__FILE__),"lib","devops_assist") #'./lib/devops_assist'
9
10
 
10
11
  task default: :spec
@@ -31,7 +31,6 @@ Gem::Specification.new do |spec|
31
31
  spec.require_paths = ["lib"]
32
32
 
33
33
  spec.add_dependency 'toolrack'
34
- #spec.add_dependency 'tlogger'
35
34
  spec.add_dependency 'teLogger'
36
35
  spec.add_dependency 'tty-prompt'
37
36
 
data/lib/Rakefile CHANGED
@@ -4,6 +4,5 @@
4
4
 
5
5
  path = File.expand_path(File.dirname(__FILE__))
6
6
  Dir.glob("#{path}/../tasks/**/*.rake").each { |f|
7
- #p f
8
7
  import f
9
8
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DevopsAssist
4
- VERSION = "0.2.1"
4
+ VERSION = "0.3.3"
5
5
  end
@@ -6,24 +6,33 @@ module DevopsAssist
6
6
  extend DevopsAssist::Gem
7
7
  extend TR::VUtils
8
8
 
9
- def self.prompt_version(gemName, last_version = "0.0.0")
9
+ def self.prompt_version(gemName, last_version = "0.1.0")
10
10
 
11
11
  begin
12
12
 
13
- last_version = "0.0.0" if is_empty?(last_version)
13
+ last_version = "0.1.0" if is_empty?(last_version)
14
14
 
15
15
  pmt = TTY::Prompt.new
16
16
  vers = possible_versions(last_version)
17
17
 
18
- vers << "Custom"
19
- vers << "Quit"
18
+ vv = []
19
+
20
+ vv << vers[2]
21
+ vv << vers[1]
22
+ vv << vers[0]
23
+
24
+ #vers << "Custom"
25
+ #vers << "Quit"
26
+ vv << "Custom"
27
+ vv << "Quit"
20
28
  #vers << [ \
21
29
  # "Maybe not now..." \
22
30
  # ,"Nah, forget it..." \
23
31
  #].sample
24
32
 
25
33
  vsel = pmt.select(" Please select one of the versions below:") do |menu|
26
- vers.each do |v|
34
+ #vers.each do |v|
35
+ vv.each do |v|
27
36
  menu.choice v
28
37
  end
29
38
  end
@@ -31,7 +40,7 @@ module DevopsAssist
31
40
  case vsel
32
41
  when "Custom"
33
42
  vsel = pmt.ask(" Please provide custom version no:", required: true)
34
- when vers[-1]
43
+ when vv[-1]
35
44
  raise DevopsAssist::Error, " Aborted. Have a nice day! "
36
45
  end
37
46
 
data/lib/devops_assist.rb CHANGED
@@ -15,9 +15,29 @@ require 'teLogger'
15
15
  module DevopsAssist
16
16
  class Error < StandardError; end
17
17
  # Your code goes here...
18
+
19
+ EnvKey = "DEVOPS_ASSIST"
20
+ EnvKeyGemReleasing = "#{EnvKey}_GEM_RELEASING"
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
+
18
39
  end
19
40
 
20
41
  # load the rake tasks
21
42
  rf = File.join(File.dirname(__FILE__),"Rakefile")
22
43
  load rf
23
-
@@ -7,17 +7,25 @@ namespace :devops do
7
7
 
8
8
  desc "Release gem file project"
9
9
  task :release do
10
-
10
+
11
+ if DevopsAssist.is_debug_mode?
12
+ STDOUT.puts "\n *********** DEBUG MODE ACTIVATED *************\n\n"
13
+ end
14
+
11
15
  begin
12
16
 
13
17
  pmt = TTY::Prompt.new
14
18
 
15
19
  root = Dir.getwd
16
20
 
21
+ # let's mark the session to allow automated context switching
22
+ ENV[DevopsAssist::EnvKeyGemReleasing] = "true"
23
+
17
24
  gemName = find_gem_name(root)
18
25
 
19
26
  pmt.say " Starting gem release for gem #{gemName}", color: :yellow
20
27
 
28
+ DevopsAssist.debug "About to execute VCS Checkin"
21
29
  # check in source code
22
30
  res = Rake::Task["devops:vcs:checkin_changes"].execute
23
31
  pmt.say " Workspace check in done\n", color: :yellow
@@ -64,10 +72,11 @@ namespace :devops do
64
72
 
65
73
  Rake::Task["devops:vcs:push_source_code"].execute({ root: root, pmt: pmt })
66
74
 
67
- rescue GitCliPrompt::UserAborted, GitCliPrompt::UserChangedMind
75
+ rescue GitCliPrompt::UserAborted, GitCliPrompt::UserChangedMind, TTY::Reader::InputInterrupt
68
76
  rescue Exception => ex
69
77
  STDERR.puts ex.message
70
- #STDERR.puts ex.backtrace.join('\n')
78
+ STDERR.puts ex.backtrace.join('\n') if DevopsAssist.is_debug_mode?
79
+ STDOUT.puts "\n\nAborted\n"
71
80
  end
72
81
 
73
82
  end
data/tasks/gem.rake CHANGED
@@ -34,40 +34,45 @@ namespace :devops do
34
34
  pmt = args[:pmt]
35
35
  version = args[:version]
36
36
 
37
- ans = pmt.yes?(" Proceed to publish the gem to Rubygems?")
38
- if ans
39
- res, tg, out = publish_gem(version) do |*args|
40
- ops = args.first
41
- case ops
42
- when :multiple_rubygems_account
43
- acct = args[1]
44
- selAct = pmt.select(" Please select one of the Rubygems credential to release:") do |menu|
45
-
46
- acct.each do |k,v|
47
- menu.choice k, k
37
+ begin
38
+ ans = pmt.yes?(" Proceed to publish the gem to Rubygems?")
39
+ if ans
40
+ res, tg, out = publish_gem(version) do |*args|
41
+ ops = args.first
42
+ case ops
43
+ when :multiple_rubygems_account
44
+ acct = args[1]
45
+ selAct = pmt.select(" Please select one of the Rubygems credential to release:") do |menu|
46
+
47
+ acct.each do |k,v|
48
+ menu.choice k, k
49
+ end
50
+
51
+ menu.choice "Skip", :skip
52
+ menu.choice "Quit", :quit
53
+
48
54
  end
49
55
 
50
- menu.choice "Skip", :skip
51
- menu.choice "Quit", :quit
56
+ raise DevopsAssist::Error, " Aborted. Have a nice day " if selAct == :quit
52
57
 
58
+ selAct
53
59
  end
54
-
55
- raise DevopsAssist::Error, " Aborted. Have a nice day " if selAct == :quit
56
-
57
- selAct
58
60
  end
59
- end
60
61
 
61
- pmt.say(" Gem publishing is skipped", color: :yellow) if res == :skipped
62
+ pmt.say(" Gem publishing is skipped", color: :yellow) if res == :skipped
62
63
 
63
- if res.respond_to?(:success?)
64
- if res.success?
65
- pmt.say " Gem published!\n", color: :yellow
66
- else
67
- pmt.say " Gem publishing failed. Return message :\n#{out}", color: :red
64
+ if res.respond_to?(:success?)
65
+ if res.success?
66
+ pmt.say " Gem published!\n", color: :yellow
67
+ else
68
+ pmt.say " Gem publishing failed. Return message :\n#{out}", color: :red
69
+ end
68
70
  end
71
+
69
72
  end
70
73
 
74
+ rescue Exception => ex
75
+ pmt.error "Pushing to Rubygems failed. Error was : #{ex.message}\n\nPlease manually release to Rubygems"
71
76
  end
72
77
 
73
78
  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.2.1
4
+ version: 0.3.3
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: 2022-08-11 00:00:00.000000000 Z
11
+ date: 2023-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toolrack
@@ -125,7 +125,7 @@ files:
125
125
  homepage: ''
126
126
  licenses: []
127
127
  metadata: {}
128
- post_install_message:
128
+ post_install_message:
129
129
  rdoc_options: []
130
130
  require_paths:
131
131
  - lib
@@ -140,8 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.2.22
144
- signing_key:
143
+ rubygems_version: 3.4.6
144
+ signing_key:
145
145
  specification_version: 4
146
146
  summary: ''
147
147
  test_files: []