mina-sidekiq 1.0.0 → 1.0.1
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/Changelog.md +4 -0
- data/Gemfile.lock +3 -3
- data/README.md +33 -28
- data/lib/mina_sidekiq/tasks.rb +28 -26
- data/lib/mina_sidekiq/version.rb +1 -1
- data/mina-sidekiq.gemspec +1 -1
- data/test_env/config/deploy.rb +1 -7
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acfbee2bf568322c26dd1d8b8db732c9d9662184
|
4
|
+
data.tar.gz: e04cb0de6682f4c5727bfec73f710ad6b4c70151
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2625ff578aea58664567ae903a2113c630ee5a92b25bc5810326b08404447e5a26b45f5d5e5c90e99f7ce6be62da39b1c07eeac9fd0bb753de8edb6e38bd7af
|
7
|
+
data.tar.gz: ce034454db6285509d08bb6cb71fe2b36649b3769fcd99f73e16384ae2a130b40e57b0e4912b763ba67cade8c0d71c294c026c308d3b375a57c925bc47412151
|
data/Changelog.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,7 +2,7 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
mina-sidekiq (1.0.0)
|
5
|
-
mina (>= 1.0.
|
5
|
+
mina (>= 1.0.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://www.rubygems.org/
|
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
byebug (9.0.6)
|
11
11
|
coderay (1.1.1)
|
12
12
|
method_source (0.8.2)
|
13
|
-
mina (1.0.
|
13
|
+
mina (1.0.2)
|
14
14
|
open4 (~> 1.3.4)
|
15
15
|
rake
|
16
16
|
minitest (5.9.1)
|
@@ -34,4 +34,4 @@ DEPENDENCIES
|
|
34
34
|
pry-byebug
|
35
35
|
|
36
36
|
BUNDLED WITH
|
37
|
-
1.13.
|
37
|
+
1.13.3
|
data/README.md
CHANGED
@@ -6,43 +6,44 @@ mina-sidekiq
|
|
6
6
|
mina-sidekiq is a gem that adds tasks to aid in the deployment of [Sidekiq] (http://mperham.github.com/sidekiq/)
|
7
7
|
using [Mina] (http://nadarei.co/mina).
|
8
8
|
|
9
|
-
Starting with 1.0.0 this gem requires Mina 1.0!
|
9
|
+
Starting with 1.0.0 this gem requires Mina 1.0! (thanks [@devvmh](https://github.com/devvmh))
|
10
10
|
|
11
11
|
# Getting Start
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
15
|
-
|
15
|
+
```console
|
16
|
+
gem install mina-sidekiq
|
17
|
+
```
|
16
18
|
|
17
19
|
## Example
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
21
|
+
```ruby
|
22
|
+
require 'mina_sidekiq/tasks'
|
23
|
+
#...
|
24
|
+
|
25
|
+
task :setup do
|
26
|
+
# sidekiq needs a place to store its pid file and log file
|
27
|
+
command %(mkdir -p "#{fetch(:deploy_to)}/shared/pids/")
|
28
|
+
command %(mkdir -p "#{fetch(:deploy_to)}/shared/log/")
|
29
|
+
end
|
30
|
+
|
31
|
+
task :deploy do
|
32
|
+
deploy do
|
33
|
+
# stop accepting new workers
|
34
|
+
invoke :'sidekiq:quiet'
|
35
|
+
invoke :'git:clone'
|
36
|
+
invoke :'deploy:link_shared_paths'
|
22
37
|
...
|
23
|
-
# to make logs persistent between deploys
|
24
|
-
set :shared_paths, ['log']
|
25
38
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
queue! %[mkdir -p "#{deploy_to}/shared/log/"]
|
39
|
+
on :launch do
|
40
|
+
...
|
41
|
+
invoke :'sidekiq:restart'
|
30
42
|
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
```
|
31
46
|
|
32
|
-
task :deploy do
|
33
|
-
deploy do
|
34
|
-
# stop accepting new workers
|
35
|
-
invoke :'sidekiq:quiet'
|
36
|
-
invoke :'git:clone'
|
37
|
-
invoke :'deploy:link_shared_paths'
|
38
|
-
...
|
39
|
-
|
40
|
-
to :launch do
|
41
|
-
...
|
42
|
-
invoke :'sidekiq:restart'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
47
|
|
47
48
|
## Available Tasks
|
48
49
|
|
@@ -71,12 +72,16 @@ under the Sharing pref pane. You will also need a working rvm installation.
|
|
71
72
|
|
72
73
|
To run the full blown test suite use:
|
73
74
|
|
74
|
-
|
75
|
+
```console
|
76
|
+
bundle exec rake test
|
77
|
+
```
|
75
78
|
|
76
79
|
For faster release cycle use
|
77
80
|
|
78
|
-
|
79
|
-
|
81
|
+
```console
|
82
|
+
cd test_env
|
83
|
+
bundle exec mina deploy --verbose
|
84
|
+
```
|
80
85
|
|
81
86
|
## Copyright
|
82
87
|
|
data/lib/mina_sidekiq/tasks.rb
CHANGED
@@ -76,15 +76,16 @@ namespace :sidekiq do
|
|
76
76
|
desc "Quiet sidekiq (stop accepting new work)"
|
77
77
|
task :quiet => :environment do
|
78
78
|
comment 'Quiet sidekiq (stop accepting new work)'
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
79
|
+
in_path(fetch(:current_path)) do
|
80
|
+
for_each_process do |pid_file, idx|
|
81
|
+
command %{
|
82
|
+
if [ -f #{pid_file} ] && kill -0 `cat #{pid_file}` > /dev/null 2>&1; then
|
83
|
+
#{fetch(:sidekiqctl)} quiet #{pid_file}
|
84
|
+
else
|
85
|
+
echo 'Skip quiet command (no pid file found)'
|
86
|
+
fi
|
87
|
+
}.strip
|
88
|
+
end
|
88
89
|
end
|
89
90
|
end
|
90
91
|
|
@@ -92,15 +93,16 @@ namespace :sidekiq do
|
|
92
93
|
desc "Stop sidekiq"
|
93
94
|
task :stop => :environment do
|
94
95
|
comment 'Stop sidekiq'
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
96
|
+
in_path(fetch(:current_path)) do
|
97
|
+
for_each_process do |pid_file, idx|
|
98
|
+
command %{
|
99
|
+
if [ -f #{pid_file} ] && kill -0 `cat #{pid_file}`> /dev/null 2>&1; then
|
100
|
+
#{fetch(:sidekiqctl)} stop #{pid_file} #{fetch(:sidekiq_timeout)}
|
101
|
+
else
|
102
|
+
echo 'Skip stopping sidekiq (no pid file found)'
|
103
|
+
fi
|
104
|
+
}.strip
|
105
|
+
end
|
104
106
|
end
|
105
107
|
end
|
106
108
|
|
@@ -108,14 +110,14 @@ namespace :sidekiq do
|
|
108
110
|
desc "Start sidekiq"
|
109
111
|
task :start => :environment do
|
110
112
|
comment 'Start sidekiq'
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
113
|
+
in_path(fetch(:current_path)) do
|
114
|
+
for_each_process do |pid_file, idx|
|
115
|
+
sidekiq_concurrency = fetch(:sidekiq_concurrency)
|
116
|
+
concurrency_arg = if sidekiq_concurrency.nil?
|
117
|
+
""
|
118
|
+
else
|
119
|
+
"-c #{sidekiq_concurrency}"
|
120
|
+
end
|
119
121
|
command %[#{fetch(:sidekiq)} -d -e #{fetch(:rails_env)} #{concurrency_arg} -C #{fetch(:sidekiq_config)} -i #{idx} -P #{pid_file} -L #{fetch(:sidekiq_log)}]
|
120
122
|
end
|
121
123
|
end
|
data/lib/mina_sidekiq/version.rb
CHANGED
data/mina-sidekiq.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_runtime_dependency 'mina', '>= 1.0.
|
20
|
+
s.add_runtime_dependency 'mina', '>= 1.0.2'
|
21
21
|
s.add_development_dependency 'pry-byebug'
|
22
22
|
s.add_development_dependency 'minitest'
|
23
23
|
end
|
data/test_env/config/deploy.rb
CHANGED
@@ -14,14 +14,8 @@ set :repository, 'https://github.com/Mic92/mina-sidekiq-test-rails.git'
|
|
14
14
|
set :keep_releases, 2
|
15
15
|
set :sidekiq_processes, 2
|
16
16
|
|
17
|
-
set :shared_dirs, fetch(:shared_dirs, []).push('log')
|
18
|
-
|
19
17
|
task :environment do
|
20
|
-
|
21
|
-
# invoke :'rvm:use', ENV.fetch('RUBY_VERSION', 'ruby-2.3.1')
|
22
|
-
env = ENV.fetch('RUBY_VERSION', 'ruby-2.3.1')
|
23
|
-
command %{source #{fetch(:rvm_use_path)}}
|
24
|
-
command %{rvm use "#{env}" --create}
|
18
|
+
invoke :'rvm:use', ENV.fetch('RUBY_VERSION', 'ruby-2.3.1')
|
25
19
|
end
|
26
20
|
|
27
21
|
task setup: :environment do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joerg Thalheim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mina
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.
|
19
|
+
version: 1.0.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.
|
26
|
+
version: 1.0.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pry-byebug
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|