deploy_pin 1.7.4 → 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 +4 -4
- data/README.md +8 -1
- data/lib/deploy_pin/collector.rb +10 -2
- data/lib/deploy_pin/runner.rb +4 -0
- data/lib/deploy_pin/task.rb +6 -2
- data/lib/deploy_pin/version.rb +1 -1
- data/lib/generators/deploy_pin/task/task_generator.rb +4 -0
- data/lib/tasks/deploy_pin_tasks.rake +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz: '
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '04533880b9157ac1f1d494d73b548c3e72ee4be5ede6123a6f42fbdf4d896b44'
|
|
4
|
+
data.tar.gz: 0f66c64807d0af17f219f5129ba1427a1307f477c9d1e005265335c64962406d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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:
|
data/lib/deploy_pin/collector.rb
CHANGED
|
@@ -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) }
|
data/lib/deploy_pin/runner.rb
CHANGED
|
@@ -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 ========')
|
data/lib/deploy_pin/task.rb
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# Task wrapper
|
|
4
4
|
module DeployPin
|
|
5
|
-
|
|
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
|
-
|
|
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
|
data/lib/deploy_pin/version.rb
CHANGED
|
@@ -36,6 +36,10 @@ module DeployPin
|
|
|
36
36
|
|
|
37
37
|
def validate
|
|
38
38
|
raise Thor::Error, set_color('Missing required option: --group', :red) if options[:group].blank?
|
|
39
|
+
|
|
40
|
+
return if DeployPin.groups.include?(options[:group])
|
|
41
|
+
|
|
42
|
+
raise Thor::Error, set_color("Group '#{options[:group]}' is not defined in DeployPin.groups", :red)
|
|
39
43
|
end
|
|
40
44
|
end
|
|
41
45
|
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.
|
|
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.
|
|
282
|
+
rubygems_version: 3.6.9
|
|
283
283
|
specification_version: 4
|
|
284
284
|
summary: pin some task around deployment
|
|
285
285
|
test_files: []
|