deploy_pin 1.7.5 → 1.7.6

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: e87d64a7e5ec829127f031b66d3ef68f14483d3f44d8ca6dd1c23a7d6defcdf8
4
- data.tar.gz: e7a263cc89bdba41ab34eb7b90a0ac4bb38e7f0936a8684af965f31fbce0bb05
3
+ metadata.gz: '04533880b9157ac1f1d494d73b548c3e72ee4be5ede6123a6f42fbdf4d896b44'
4
+ data.tar.gz: 0f66c64807d0af17f219f5129ba1427a1307f477c9d1e005265335c64962406d
5
5
  SHA512:
6
- metadata.gz: a7f4d72a7c7856f3b6d1bfc70c4a1f0992eb3f8f0b956c4044c203d172bb57578b731292b664345627c925a9e77c9d73d082ae281941bf2312f1d431aeb4720a
7
- data.tar.gz: 1e8b9d6c4591e65ff806b4a7d80289640a861a49156676606d54a29b050c8f598c1d5b36499db184fa7f41bfe659cea72937d21420eeaa7935d7c63834b6fdd7
6
+ metadata.gz: 436ed2a59bc9af20add804759c95fa5835e330a2468b5d5257941cc478dc7f714b832bb7fe289cc0fbd068cb0050aa7e00f9995b2cdc7fb5146eb479e6eae42e
7
+ data.tar.gz: e3b6493cf98ec3d13548faa56005fb7807f120bba4d317eed9b3d628b7ceee70c422d1317458ac3c7811126adace3be4579acdb34463ccd0697f397b9caca5cd
data/README.md CHANGED
@@ -226,6 +226,13 @@ rails g deploy_pin:task some_task_title --recurring --identifier 5
226
226
  rails g deploy_pin:task some_task_title --parallel --recurring --identifier 5
227
227
  ```
228
228
 
229
+ ## Mark Tasks as Done
230
+
231
+ ```bash
232
+ rake deploy_pin:mark_done['identifier_1, identifier_2'] # marks specific tasks as done
233
+ rake deploy_pin:mark_done # marks all tasks as done. useful in seed file
234
+ ```
235
+
229
236
  ## DeploymentStateTrack
230
237
  In the initializer
231
238
  ```ruby
@@ -275,7 +282,7 @@ To ensure your changes meet the required standards and pass all tests before sub
275
282
  Use the following command to simulate the workflow locally:
276
283
 
277
284
  ```bash
278
- act pull_request --secret-file .env --container-architecture linux/amd64 -W .github/workflows -j rspec
285
+ act pull_request --secret-file .env --container-architecture linux/amd64 -W .github/workflows -j test
279
286
  ```
280
287
 
281
288
  This command does the following:
@@ -11,7 +11,6 @@ module DeployPin
11
11
 
12
12
  # :reek:TooManyStatements
13
13
  def run
14
- # cache tasks
15
14
  tasks = init_tasks
16
15
  tasks.each_with_index do |task, index|
17
16
  DeployPin.task_wrapper.call(task, -> { process(tasks, task, index) })
@@ -34,8 +33,17 @@ module DeployPin
34
33
  end
35
34
  end
36
35
 
36
+ # :reek:FeatureEnvy
37
+ def mark_done
38
+ tasks = init_tasks
39
+ tasks.each do |task|
40
+ task.prepare
41
+ task.mark
42
+ end
43
+ end
44
+ # :reek:FeatureEnvy
45
+
37
46
  def executable
38
- # cache tasks
39
47
  tasks = init_tasks
40
48
  tasks.map.with_index do |task, index|
41
49
  task if tasks[0..index].none? { |other_task| task.eql?(other_task) }
@@ -15,6 +15,10 @@ module DeployPin
15
15
  DeployPin::Collector.new(identifiers:).short_list
16
16
  end
17
17
 
18
+ def self.mark_done(identifiers:)
19
+ DeployPin::Collector.new(identifiers:).mark_done
20
+ end
21
+
18
22
  def self.summary(identifiers:)
19
23
  # print summary
20
24
  self.print('======= Summary ========')
@@ -2,7 +2,8 @@
2
2
 
3
3
  # Task wrapper
4
4
  module DeployPin
5
- class Task
5
+ # :reek:TooManyMethods
6
+ class Task # rubocop:disable Metrics/ClassLength
6
7
  extend ::DeployPin::ParallelWrapper
7
8
  include ::DeployPin::ParallelWrapper
8
9
 
@@ -73,7 +74,8 @@ module DeployPin
73
74
  !explicit_timeout? && !parallel?
74
75
  end
75
76
 
76
- def parse
77
+ # :reek:TooManyStatements
78
+ def parse # rubocop:disable Metrics/MethodLength
77
79
  each_line do |line|
78
80
  case line.strip
79
81
  when /\A# (-?\d+):(\w+):?(recurring)?/
@@ -92,6 +94,7 @@ module DeployPin
92
94
  end
93
95
  end
94
96
  end
97
+ # :reek:TooManyStatements
95
98
 
96
99
  def each_line(&block)
97
100
  if file.starts_with?('# no_file_task')
@@ -146,4 +149,5 @@ module DeployPin
146
149
  @parallel
147
150
  end
148
151
  end
152
+ # :reek:TooManyMethods
149
153
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeployPin
4
- VERSION = '1.7.5'
4
+ VERSION = '1.7.6'
5
5
  end
@@ -22,4 +22,11 @@ namespace :deploy_pin do
22
22
  DeployPin::Runner.short_list(**args)
23
23
  DeployPin::Runner.summary(**args)
24
24
  end
25
+
26
+ task :mark_done, [:identifiers] => :environment do |_t, args|
27
+ args.with_defaults(identifiers: DeployPin.groups)
28
+
29
+ DeployPin::Runner.mark_done(**args)
30
+ DeployPin::Runner.summary(**args)
31
+ end
25
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploy_pin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.5
4
+ version: 1.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viktor Sych
@@ -279,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
279
  - !ruby/object:Gem::Version
280
280
  version: '0'
281
281
  requirements: []
282
- rubygems_version: 3.6.7
282
+ rubygems_version: 3.6.9
283
283
  specification_version: 4
284
284
  summary: pin some task around deployment
285
285
  test_files: []