deploy_pin 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -5
- data/lib/deploy_pin/version.rb +1 -1
- data/lib/generators/deploy_pin/task/USAGE +2 -2
- data/lib/generators/deploy_pin/task/task_generator.rb +6 -5
- data/lib/generators/deploy_pin/task/templates/parallel_task.rb.erb +2 -2
- data/lib/generators/deploy_pin/task/templates/task.rb.erb +3 -3
- 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: 0133c82dd0826300585629d58af3f3e10a58b481e7c65a589a834fd0d7d79bdd
|
4
|
+
data.tar.gz: 220af2e000347c6835673f664f3413d3775cba0d3f1ccb9778cd324fcce1f08a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 602e2f80e418e91e0d0045b5f5635c001d221217566581df4eea11b499dcd974b188b5de5adc7b37452c156f2c00d35b8238e4bc80a6d50ba2c962d48df7952f
|
7
|
+
data.tar.gz: 202f198bb6197464495d7b418a568022b2869bf8800c959ffc09310db7a7335c16bd902652cda7b5ee2a734335bb88e35722f278f84005683935b29e6a0c9651
|
data/README.md
CHANGED
@@ -21,9 +21,14 @@ deploy_pins is exactly what you need.
|
|
21
21
|
|
22
22
|
To generate new task template file
|
23
23
|
```bash
|
24
|
-
rails g deploy_pin:task
|
24
|
+
rails g deploy_pin:task some_task_title
|
25
25
|
# or
|
26
|
-
rails g deploy_pin:task --parallel
|
26
|
+
rails g deploy_pin:task some_task_title --parallel
|
27
|
+
```
|
28
|
+
|
29
|
+
Also, you can specify author
|
30
|
+
```bash
|
31
|
+
rails g deploy_pin:task some_task_title -a author_name
|
27
32
|
```
|
28
33
|
|
29
34
|
To list all pending tasks
|
@@ -40,11 +45,10 @@ rake deploy_pin:run
|
|
40
45
|
|
41
46
|
Please define allowed groups in `config/initializers/deploy_pin.rb`
|
42
47
|
if you want to group tasks around "allowed_group"
|
43
|
-
|
44
48
|
```bash
|
45
|
-
rails g deploy_pin:task allowed_group
|
49
|
+
rails g deploy_pin:task task_title -g allowed_group
|
46
50
|
# or
|
47
|
-
rails g deploy_pin:task allowed_group --parallel
|
51
|
+
rails g deploy_pin:task task_title -g allowed_group --parallel
|
48
52
|
```
|
49
53
|
|
50
54
|
To list all pending tasks
|
data/lib/deploy_pin/version.rb
CHANGED
@@ -2,22 +2,23 @@
|
|
2
2
|
|
3
3
|
class DeployPin::TaskGenerator < Rails::Generators::Base
|
4
4
|
class_option :parallel, type: :boolean
|
5
|
-
argument :
|
5
|
+
argument :title, required: true
|
6
|
+
class_option :group, aliases: "-g", default: DeployPin.fallback_group
|
7
|
+
class_option :author, aliases: "-a"
|
6
8
|
|
7
9
|
source_root File.expand_path('templates', __dir__)
|
8
10
|
|
9
11
|
desc 'This generator creates deploy_pin task at lib/deploy_pin/'
|
10
12
|
def create_task_file
|
11
|
-
raise "Not allowed 'group' argument! possible values are #{DeployPin.groups}" \
|
12
|
-
unless DeployPin.groups.include?(group)
|
13
|
-
|
14
13
|
template_file = if options[:parallel]
|
15
14
|
'parallel_task.rb.erb'
|
16
15
|
else
|
17
16
|
'task.rb.erb'
|
18
17
|
end
|
19
18
|
|
19
|
+
@author = options[:author] || ENV["USER"]
|
20
|
+
@group = options[:group]
|
20
21
|
@uuid = Time.now.strftime('%Y%m%d%H%M%S')
|
21
|
-
template template_file, "#{DeployPin.tasks_path}/#{@uuid}
|
22
|
+
template template_file, "#{DeployPin.tasks_path}/#{@uuid}_#{title}.rb"
|
22
23
|
end
|
23
24
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# <%= @uuid %>:<%= group %>
|
4
|
-
# task_title:
|
3
|
+
# <%= @uuid %>:<%= @group %>
|
4
|
+
# task_title: <%= @author ? "@#{@author} #{title.titleize}" : "#{title.titleize}" %>
|
5
5
|
|
6
6
|
# === parallel task code goes down here ===
|
7
7
|
10.times { DeployPin::Record.create(uuid: "hello") }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# <%= @uuid %>:<%= group %>
|
4
|
-
# task_title:
|
3
|
+
# <%= @uuid %>:<%= @group %>
|
4
|
+
# task_title: <%= @author ? "@#{@author} #{title.titleize}" : "#{title.titleize}" %>
|
5
5
|
|
6
6
|
# === task code goes down here ===
|
7
7
|
progressbar = ProgressBar.create(title: "Doing stuff", total: 20, format: '%t |%E | %B | %a')
|
@@ -12,4 +12,4 @@ progressbar = ProgressBar.create(title: "Doing stuff", total: 20, format: '%t |%
|
|
12
12
|
# ActiveRecord::Base.connection.execute("select * from shipments;")
|
13
13
|
# or
|
14
14
|
# Shipment.all
|
15
|
-
# end
|
15
|
+
# end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploy_pin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Viktor Sych
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|