rops 1.4.3 → 1.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 926388756efcd2dc90f1ea69ea4f277c20ae3ce4f6144c1e924b4ea3bb9aa80b
4
- data.tar.gz: 2cb4463b96572808649bad097306fdbf4378355577e73e915a472a8850e4a93c
3
+ metadata.gz: 5c03621bf9e8019dbc60a1e01584088cefe4b6b0cf4ddc262f6d7141b9cd0020
4
+ data.tar.gz: f3f7ba0e78dfac69c2f496e2536a2dea1cc2ff93f9d03f26208fe0e7ba741955
5
5
  SHA512:
6
- metadata.gz: 286a04a4439608acf261a1c272b1dd5b034b275d35c1bc079260549b02687a6a049f58b5db6003ea80cc2f87db0aff09cb4e7b0b7f420febd7e687e9c1428dc1
7
- data.tar.gz: 39c0dcc66bf41a46e0a7052cbb9e2ae91926401215f6b682ef91b844c0614dcc0d01c41043e4b7fcc3c45d8577d8004a3d2615f0f06b6aac90696d8dc5155901
6
+ metadata.gz: a3bc57222a2437c4135b5613c81d41c4047a6a8aa2cc7d689f6d35537f71b85de04c7c1c21096c6eef7856067da2f6ddfbdb7f3012a0902768664245e604ed5b
7
+ data.tar.gz: 8621cb2b09845b1afd1b09abd0261db5fdcdace893c80ffde92c3ff43c23aead39427806472900fef211aab8578d40a2be99e04b461a7dc7aad618b60cf62ebd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rops (1.4.3)
4
+ rops (1.4.4)
5
5
  activesupport (~> 7.0.3)
6
6
  dry-cli (~> 0.7.0)
7
7
  git (>= 1.9.1, < 1.14.0)
@@ -13,12 +13,12 @@ PATH
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- activesupport (7.0.4.2)
16
+ activesupport (7.0.7.2)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
20
20
  tzinfo (~> 2.0)
21
- addressable (2.8.1)
21
+ addressable (2.8.5)
22
22
  public_suffix (>= 2.0.2, < 6.0)
23
23
  concurrent-ruby (1.2.2)
24
24
  crack (0.4.5)
@@ -29,31 +29,31 @@ GEM
29
29
  addressable (~> 2.8)
30
30
  rchardet (~> 1.8)
31
31
  hashdiff (1.0.1)
32
- i18n (1.12.0)
32
+ i18n (1.14.1)
33
33
  concurrent-ruby (~> 1.0)
34
34
  liquid (5.4.0)
35
- minitest (5.18.0)
35
+ minitest (5.20.0)
36
36
  net-ssh (7.0.1)
37
37
  ptools (1.4.3)
38
- public_suffix (5.0.1)
38
+ public_suffix (5.0.3)
39
39
  rchardet (1.8.0)
40
- rexml (3.2.5)
40
+ rexml (3.2.6)
41
41
  rspec (3.12.0)
42
42
  rspec-core (~> 3.12.0)
43
43
  rspec-expectations (~> 3.12.0)
44
44
  rspec-mocks (~> 3.12.0)
45
- rspec-core (3.12.1)
45
+ rspec-core (3.12.2)
46
46
  rspec-support (~> 3.12.0)
47
- rspec-expectations (3.12.2)
47
+ rspec-expectations (3.12.3)
48
48
  diff-lcs (>= 1.2.0, < 2.0)
49
49
  rspec-support (~> 3.12.0)
50
- rspec-mocks (3.12.3)
50
+ rspec-mocks (3.12.6)
51
51
  diff-lcs (>= 1.2.0, < 2.0)
52
52
  rspec-support (~> 3.12.0)
53
- rspec-support (3.12.0)
53
+ rspec-support (3.12.1)
54
54
  tzinfo (2.0.6)
55
55
  concurrent-ruby (~> 1.0)
56
- webmock (3.18.1)
56
+ webmock (3.19.0)
57
57
  addressable (>= 2.8.0)
58
58
  crack (>= 0.3.2)
59
59
  hashdiff (>= 0.4.0, < 2.0.0)
data/bin/rops CHANGED
@@ -31,22 +31,13 @@ module Record360
31
31
 
32
32
  def call(branch: nil, context: nil, root: nil, specs: nil, **)
33
33
  @root = root if root
34
- @deployer ||= Deployer.new(@root)
35
- deployer.branch = branch if branch
34
+ @deployer ||= Deployer.new(@root, branch: branch)
36
35
  deployer.spec_dir = specs if specs
37
36
  @context = context || deployer.default_context
38
37
  end
39
38
 
40
39
  protected
41
40
 
42
- def format_commit(commit)
43
- message = commit.message
44
- if message.include?("\n")
45
- message = message.split("\n").first + " ..."
46
- end
47
- "#{commit.date} [#{commit.sha[0,8]}] #{message}"
48
- end
49
-
50
41
  def print_statuses(context, spec_statuses = nil)
51
42
  spec_statuses ||= deployer.specs_running(context)
52
43
  return if spec_statuses.blank?
@@ -148,49 +139,6 @@ module Record360
148
139
  end
149
140
  end
150
141
 
151
- class ReadyTag < Dry::CLI::Command
152
- desc "Mark your latest commit that's ready for production"
153
- argument :commit, desc: "Commit to tag as ready for production"
154
- include Common
155
-
156
- def call(commit: nil, **args)
157
- super(branch: commit, **args)
158
- repo = deployer.send(:git)
159
- name, email = repo.config.values_at('user.name', 'user.email')
160
- if name.blank?
161
- puts "Unable to find user name in Git config. Run `git config --global user.name \"FIRST_NAME LAST_NAME\"`"
162
- exit(-1)
163
- elsif email.blank?
164
- puts "Unable to find user email in Git config. Run `git config --global user.email \"EMAIL_ADDRESS\"`"
165
- exit(-1)
166
- end
167
- tag = 'ready-' + name.split(' ').first.downcase
168
-
169
- if commit
170
- c = repo.object(commit)
171
- unless c.author.email == email
172
- puts "Commit author #{c.author.name.inspect} does not match #{name.inspect}, you can only tag your own commit"
173
- exit(-1)
174
- end
175
- repo.tag(tag, c, f: true)
176
- puts "New tag set to: ", format_commit(c)
177
-
178
- elsif repo.tags.map(&:name).include?(tag)
179
- commits = repo.log.author(name).between("#{tag}^", 'master')
180
- commits[0...-1].each do |c|
181
- puts " " + format_commit(c)
182
- end
183
- puts "=> " + format_commit(commits.last)
184
- else
185
- puts "No #{tag.inspect} tag found"
186
- repo.log.author(name).to_a[0..9].each do |c|
187
- puts format_commit(c)
188
- end
189
- puts "..."
190
- end
191
- end
192
- end
193
-
194
142
  class CurrentStatus < Dry::CLI::Command
195
143
  desc "Display status of all running specs"
196
144
  argument :context, desc: "Kubernetes context"
@@ -294,7 +242,6 @@ module Record360
294
242
  end
295
243
  end
296
244
 
297
- register 'ready', ReadyTag
298
245
  register 'status', CurrentStatus
299
246
  register 'build', BuildImage
300
247
  register 'push', PushImage
data/lib/deployer.rb CHANGED
@@ -24,11 +24,11 @@ class Deployer
24
24
  docker.include?('podman')
25
25
  end
26
26
 
27
- def initialize(root = nil)
27
+ def initialize(root = nil, branch: nil)
28
28
  @specs = {}
29
29
  @root = root || Dir.pwd
30
30
  load_config
31
- self.branch = default_branch
31
+ self.branch = branch.presence || default_branch
32
32
  end
33
33
 
34
34
  def branch=(branch)
data/lib/ready.rb ADDED
File without changes
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Record360
2
2
  module Operations
3
- VERSION = '1.4.3'
3
+ VERSION = '1.4.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rops
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Sloan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-11 00:00:00.000000000 Z
11
+ date: 2024-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -133,6 +133,7 @@ files:
133
133
  - lib/deployer.rb
134
134
  - lib/git_ext.rb
135
135
  - lib/image.rb
136
+ - lib/ready.rb
136
137
  - lib/site.rb
137
138
  - lib/version.rb
138
139
  homepage: https://github.com/Record360/rops
@@ -154,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
155
  - !ruby/object:Gem::Version
155
156
  version: '0'
156
157
  requirements: []
157
- rubygems_version: 3.3.7
158
+ rubygems_version: 3.4.10
158
159
  signing_key:
159
160
  specification_version: 4
160
161
  summary: Record360 Operations tool