mina-sidekiq 0.1.0
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 +7 -0
- data/.gitignore +18 -0
- data/Gemfile +3 -0
- data/LICENSE +23 -0
- data/README.md +51 -0
- data/VERSION +1 -0
- data/lib/mina-sidekiq/sidekiq.rb +88 -0
- data/lib/mina-sidekiq.rb +3 -0
- data/mina-sidekiq.gemspec +19 -0
- metadata +66 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dfddd842974543433d1658bf90018a578c2fe195
|
4
|
+
data.tar.gz: a05e6e4a653453eb2f8368815bb4416bba4470ec
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2ea0bd1328ff7b84cffad6f308b5c46a5d171248c3973cdeec3d7220298f91b847a4e4a553ab1b901c1fbdc082fae1cb6f672017cc1db3e725f7ffb27cf3588e
|
7
|
+
data.tar.gz: db253535da730cf876d0c98cbf0c8f89a7f33119954451bcc295fabc56d762fef7eb64933f5aee4502dd8f2b1613567fdc46fc4029fe0609521a138bbeefead3
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
LICENSE
|
2
|
+
|
3
|
+
The MIT License
|
4
|
+
|
5
|
+
Copyright (c) 2012 Nadarei, Inc.
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
9
|
+
in the Software without restriction, including without limitation the rights
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
12
|
+
furnished to do so, subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
15
|
+
all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
mina-sidekiq
|
2
|
+
============
|
3
|
+
|
4
|
+
mina-sidekiq is a gem that adds tasks to aid in the deployment of [Sidekiq] (http://mperham.github.com/sidekiq/)
|
5
|
+
using [Mina] (http://nadarei.co/mina).
|
6
|
+
|
7
|
+
# Getting Start
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
gem install mina-sidekiq
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
require 'mina-sidekiq'
|
16
|
+
...
|
17
|
+
|
18
|
+
task :deploy => :enviroment do
|
19
|
+
deploy do
|
20
|
+
# stop accepting new workers
|
21
|
+
invoke :'sidekiq:quiet'
|
22
|
+
invoke :'git:clone'
|
23
|
+
...
|
24
|
+
|
25
|
+
to :launch do
|
26
|
+
...
|
27
|
+
invoke :'sidekiq:restart'
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
## Available Tasks
|
33
|
+
|
34
|
+
* sidekiq:stop
|
35
|
+
* sidekiq:start
|
36
|
+
* sidekiq:restart
|
37
|
+
* sidekiq:quiet
|
38
|
+
|
39
|
+
## Available Options
|
40
|
+
|
41
|
+
* sidekiq: Sets the path to sidekiq.
|
42
|
+
* sidekiqctl: Sets the path to sidekiqctl.
|
43
|
+
* sidekiq\_timeout: Sets a upper limit of time a worker is allowed to finish, before it is killed.
|
44
|
+
* sidekiq\_log: Sets the path to the log file of sidekiq
|
45
|
+
* sidekiq\_pid: Sets the path to the pid file of a sidekiq worker
|
46
|
+
|
47
|
+
## Copyright
|
48
|
+
|
49
|
+
Copyright (c) 2013 Jörg Thalheim http://higgsboson.tk/joerg
|
50
|
+
|
51
|
+
See LICENSE for further details.
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# # Modules: Sidekiq
|
2
|
+
# Adds settings and tasks for managing Sidekiq workers.
|
3
|
+
#
|
4
|
+
# ## Usage example
|
5
|
+
# require 'mina/sidekiq'
|
6
|
+
# ...
|
7
|
+
#
|
8
|
+
# task :deploy => :enviroment do
|
9
|
+
# deploy do
|
10
|
+
# invoke :'sidekiq:quiet'
|
11
|
+
# invoke :'git:clone'
|
12
|
+
# ...
|
13
|
+
#
|
14
|
+
# to :launch do
|
15
|
+
# ...
|
16
|
+
# invoke :'sidekiq:restart'
|
17
|
+
# end
|
18
|
+
# end
|
19
|
+
# end
|
20
|
+
|
21
|
+
require 'mina/bundler'
|
22
|
+
require 'mina/rails'
|
23
|
+
|
24
|
+
# ## Settings
|
25
|
+
# Any and all of these settings can be overriden in your `deploy.rb`.
|
26
|
+
|
27
|
+
# ### sidekiq
|
28
|
+
# Sets the path to sidekiq.
|
29
|
+
set_default :sidekiq, lambda { "#{bundle_bin} exec sidekiq" }
|
30
|
+
|
31
|
+
# ### sidekiqctl
|
32
|
+
# Sets the path to sidekiqctl.
|
33
|
+
set_default :sidekiqctl, lambda { "#{bundle_prefix} sidekiqctl" }
|
34
|
+
|
35
|
+
# ### sidekiq_timeout
|
36
|
+
# Sets a upper limit of time a worker is allowed to finish, before it is killed.
|
37
|
+
set_default :sidekiq_timeout, 10
|
38
|
+
|
39
|
+
# ### sidekiq_config
|
40
|
+
# Sets the path to the configuration file of sidekiq
|
41
|
+
set_default :sidekiq_config, "./config/sidekiq.yml"
|
42
|
+
|
43
|
+
# ### sidekiq_log
|
44
|
+
# Sets the path to the log file of sidekiq
|
45
|
+
#
|
46
|
+
# To disable logging set it to "/dev/null"
|
47
|
+
set_default :sidekiq_log, "./log/sidekiq.log"
|
48
|
+
|
49
|
+
# ### sidekiq_pid
|
50
|
+
# Sets the path to the pid file of a sidekiq worker
|
51
|
+
set_default :sidekiq_pid, lambda { "#{deploy_to}/#{shared_path}/pids/sidekiq.pid" }
|
52
|
+
|
53
|
+
# ## Control Tasks
|
54
|
+
namespace :sidekiq do
|
55
|
+
# ### sidekiq:quiet
|
56
|
+
desc "Quiet sidekiq (stop accepting new work)"
|
57
|
+
task :quiet do
|
58
|
+
queue %{ if [ -f #{sidekiq_pid} ]; then
|
59
|
+
echo "-----> Quiet sidekiq (stop accepting new work)"
|
60
|
+
#{echo_cmd %{(cd #{deploy_to}/#{current_path} && #{sidekiqctl} quiet #{sidekiq_pid})} }
|
61
|
+
fi }
|
62
|
+
end
|
63
|
+
|
64
|
+
# ### sidekiq:stop
|
65
|
+
desc "Stop sidekiq"
|
66
|
+
task :stop do
|
67
|
+
queue %[ if [ -f #{sidekiq_pid} ]; then
|
68
|
+
echo "-----> Stop sidekiq"
|
69
|
+
#{echo_cmd %[(cd #{deploy_to}/#{current_path} && #{sidekiqctl} stop #{sidekiq_pid} #{sidekiq_timeout})]}
|
70
|
+
fi ]
|
71
|
+
end
|
72
|
+
|
73
|
+
# ### sidekiq:start
|
74
|
+
desc "Start sidekiq"
|
75
|
+
task :start do
|
76
|
+
queue %{
|
77
|
+
echo "-----> Start sidekiq"
|
78
|
+
#{echo_cmd %[(cd #{deploy_to}/#{current_path}; nohup #{sidekiq} -e #{rails_env} -C #{sidekiq_config} -P #{sidekiq_pid} >> #{sidekiq_log} 2>&1 </dev/null &) ] }
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
# ### sidekiq:restart
|
83
|
+
desc "Restart sidekiq"
|
84
|
+
task :restart do
|
85
|
+
invoke :'sidekiq:stop'
|
86
|
+
invoke :'sidekiq:start'
|
87
|
+
end
|
88
|
+
end
|
data/lib/mina-sidekiq.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "mina-sidekiq"
|
5
|
+
s.version = File.read('VERSION')
|
6
|
+
s.authors = ["Joerg Thalheim"]
|
7
|
+
s.email = ["joerg@higgsboson.tk"]
|
8
|
+
s.homepage = "http://github.com/Mic92/mina-sidekiq"
|
9
|
+
s.summary = "Tasks to deploy Sidekiq with mina."
|
10
|
+
s.description = "Adds tasks to aid in the deployment of Sidekiq"
|
11
|
+
s.license = 'MIT'
|
12
|
+
|
13
|
+
s.files = `git ls-files`.split("\n")
|
14
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
|
18
|
+
s.add_runtime_dependency "mina"
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mina-sidekiq
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Joerg Thalheim
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-06-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mina
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Adds tasks to aid in the deployment of Sidekiq
|
28
|
+
email:
|
29
|
+
- joerg@higgsboson.tk
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- .gitignore
|
35
|
+
- Gemfile
|
36
|
+
- LICENSE
|
37
|
+
- README.md
|
38
|
+
- VERSION
|
39
|
+
- lib/mina-sidekiq.rb
|
40
|
+
- lib/mina-sidekiq/sidekiq.rb
|
41
|
+
- mina-sidekiq.gemspec
|
42
|
+
homepage: http://github.com/Mic92/mina-sidekiq
|
43
|
+
licenses:
|
44
|
+
- MIT
|
45
|
+
metadata: {}
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
requirements: []
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 2.0.3
|
63
|
+
signing_key:
|
64
|
+
specification_version: 4
|
65
|
+
summary: Tasks to deploy Sidekiq with mina.
|
66
|
+
test_files: []
|