mina-sidekiq 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -6
- data/lib/mina_sidekiq/tasks.rb +14 -11
- data/lib/mina_sidekiq/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1bba161f9399c6c8cea213d7faf58b4876edb8c
|
4
|
+
data.tar.gz: 6670d52acffcb22eeefccf07a18c51b3b246b33e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51b9d652430f4cf542ebe35f9d23b8057353e4626ae2f6d501744878d0ed07449d4a63062edf7699aa8e5a47071e54ee1889046f2f4fbf200db45375ffdc82d8
|
7
|
+
data.tar.gz: 7da87f2b7e6e483237028710cb75849551c64dafba2343c5c33a02e3fd9e371e91d42384d02e352c88dc86ff7fcaf5ef587a564ef22d91352d473292edb773e3
|
data/README.md
CHANGED
@@ -51,12 +51,29 @@ using [Mina] (http://nadarei.co/mina).
|
|
51
51
|
|
52
52
|
## Available Options
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
*
|
57
|
-
*
|
58
|
-
*
|
59
|
-
*
|
54
|
+
| Option | Description |
|
55
|
+
| ------------------- | ------------------------------------------------------------------------------ |
|
56
|
+
| *sidekiq* | Sets the path to sidekiq. |
|
57
|
+
| *sidekiqctl* | Sets the path to sidekiqctl. |
|
58
|
+
| *sidekiq\_timeout* | Sets a upper limit of time a worker is allowed to finish, before it is killed. |
|
59
|
+
| *sidekiq\_log* | Sets the path to the log file of sidekiq. |
|
60
|
+
| *sidekiq\_pid* | Sets the path to the pid file of a sidekiq worker. |
|
61
|
+
| *sidekiq_processes* | Sets the number of sidekiq processes launched. |
|
62
|
+
|
63
|
+
## Testing
|
64
|
+
|
65
|
+
The test requires a local running ssh server with the ssh keys of the current
|
66
|
+
user added to its `~/.ssh/authorized_keys`. In OS X, this is "Remote Login"
|
67
|
+
under the Sharing pref pane.
|
68
|
+
|
69
|
+
To run the full blown test suite use:
|
70
|
+
|
71
|
+
bundle exec rake test
|
72
|
+
|
73
|
+
For faster release cycle use
|
74
|
+
|
75
|
+
cd test_env
|
76
|
+
bundle exec mina deploy --verbose
|
60
77
|
|
61
78
|
## Copyright
|
62
79
|
|
data/lib/mina_sidekiq/tasks.rb
CHANGED
@@ -42,7 +42,7 @@ set_default :sidekiq_timeout, 10
|
|
42
42
|
|
43
43
|
# ### sidekiq_config
|
44
44
|
# Sets the path to the configuration file of sidekiq
|
45
|
-
set_default :sidekiq_config, "
|
45
|
+
set_default :sidekiq_config, lambda { "#{deploy_to}/#{current_path}/config/sidekiq.yml" }
|
46
46
|
|
47
47
|
# ### sidekiq_log
|
48
48
|
# Sets the path to the log file of sidekiq
|
@@ -73,14 +73,15 @@ namespace :sidekiq do
|
|
73
73
|
|
74
74
|
# ### sidekiq:quiet
|
75
75
|
desc "Quiet sidekiq (stop accepting new work)"
|
76
|
-
task :quiet do
|
76
|
+
task :quiet => :environment do
|
77
77
|
queue %[echo "-----> Quiet sidekiq (stop accepting new work)"]
|
78
78
|
for_each_process do |pid_file, idx|
|
79
79
|
queue %{
|
80
|
-
if [ -
|
81
|
-
|
80
|
+
if [ -f #{pid_file} ] && kill -0 `cat #{pid_file}`> /dev/null 2>&1; then
|
81
|
+
cd "#{deploy_to}/#{current_path}"
|
82
|
+
#{echo_cmd %{#{sidekiqctl} quiet #{pid_file}} }
|
82
83
|
else
|
83
|
-
echo '
|
84
|
+
echo 'Skip quiet command (no pid file found)'
|
84
85
|
fi
|
85
86
|
}
|
86
87
|
end
|
@@ -88,14 +89,15 @@ namespace :sidekiq do
|
|
88
89
|
|
89
90
|
# ### sidekiq:stop
|
90
91
|
desc "Stop sidekiq"
|
91
|
-
task :stop do
|
92
|
+
task :stop => :environment do
|
92
93
|
queue %[echo "-----> Stop sidekiq"]
|
93
94
|
for_each_process do |pid_file, idx|
|
94
95
|
queue %[
|
95
|
-
if [ -
|
96
|
-
|
96
|
+
if [ -f #{pid_file} ] && kill -0 `cat #{pid_file}`> /dev/null 2>&1; then
|
97
|
+
cd "#{deploy_to}/#{current_path}"
|
98
|
+
#{echo_cmd %[#{sidekiqctl} stop #{pid_file} #{sidekiq_timeout}]}
|
97
99
|
else
|
98
|
-
echo '
|
100
|
+
echo 'Skip stopping sidekiq (no pid file found)'
|
99
101
|
fi
|
100
102
|
]
|
101
103
|
end
|
@@ -103,11 +105,12 @@ namespace :sidekiq do
|
|
103
105
|
|
104
106
|
# ### sidekiq:start
|
105
107
|
desc "Start sidekiq"
|
106
|
-
task :start do
|
108
|
+
task :start => :environment do
|
107
109
|
queue %[echo "-----> Start sidekiq"]
|
108
110
|
for_each_process do |pid_file, idx|
|
109
111
|
queue %{
|
110
|
-
|
112
|
+
cd "#{deploy_to}/#{current_path}"
|
113
|
+
#{echo_cmd %[nohup #{sidekiq} -e #{rails_env} -C #{sidekiq_config} -i #{idx} -P #{pid_file} >> #{sidekiq_log} 2>&1 &] }
|
111
114
|
}
|
112
115
|
end
|
113
116
|
end
|
data/lib/mina_sidekiq/version.rb
CHANGED
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: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joerg Thalheim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mina
|
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
71
|
rubyforge_project:
|
72
|
-
rubygems_version: 2.0.
|
72
|
+
rubygems_version: 2.0.7
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: Tasks to deploy Sidekiq with mina.
|