mina-sidekiq 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6a002d492fb54e6a01583a09efe302e1546e2b7
4
- data.tar.gz: 1048b8227cd914a3f026c4d251bbbf88c8f41c53
3
+ metadata.gz: acfbee2bf568322c26dd1d8b8db732c9d9662184
4
+ data.tar.gz: e04cb0de6682f4c5727bfec73f710ad6b4c70151
5
5
  SHA512:
6
- metadata.gz: e6e261d3d3cdf3f5fd4363290cbdb54dd78a5152b2715f6e94529ce61a69b72faa477a02c599e9465695ebeb6302545ec311297e9033f7c34ef690056229ba13
7
- data.tar.gz: b66da6613c2382ab9a362009fceb5cef9bb7f5bb5e2b0f756e2b19b42537ff05a069cc0b39e9546c4387218e4e7fd1416536d3bdc920d3ebd1ea22aa7e33ebaa
6
+ metadata.gz: b2625ff578aea58664567ae903a2113c630ee5a92b25bc5810326b08404447e5a26b45f5d5e5c90e99f7ce6be62da39b1c07eeac9fd0bb753de8edb6e38bd7af
7
+ data.tar.gz: ce034454db6285509d08bb6cb71fe2b36649b3769fcd99f73e16384ae2a130b40e57b0e4912b763ba67cade8c0d71c294c026c308d3b375a57c925bc47412151
data/Changelog.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 1.0.1 2016-11-17
5
+ ----------------
6
+ * restore current directory after changing to sidekiq directory
7
+
4
8
  1.0.0 2016-10-10
5
9
  ----------------
6
10
  * support for mina 1.0 (thanks @devvmh)
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.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.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.1
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
- gem install mina-sidekiq
15
+ ```console
16
+ gem install mina-sidekiq
17
+ ```
16
18
 
17
19
  ## Example
18
20
 
19
- ## Usage example
20
-
21
- require 'mina_sidekiq/tasks'
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
- task :setup do
27
- # sidekiq needs a place to store its pid file and log file
28
- queue! %[mkdir -p "#{deploy_to}/shared/pids/"]
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
- bundle exec rake test
75
+ ```console
76
+ bundle exec rake test
77
+ ```
75
78
 
76
79
  For faster release cycle use
77
80
 
78
- cd test_env
79
- bundle exec mina deploy --verbose
81
+ ```console
82
+ cd test_env
83
+ bundle exec mina deploy --verbose
84
+ ```
80
85
 
81
86
  ## Copyright
82
87
 
@@ -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
- for_each_process do |pid_file, idx|
80
- command %{
81
- if [ -f #{pid_file} ] && kill -0 `cat #{pid_file}` > /dev/null 2>&1; then
82
- cd "#{fetch(:current_path)}"
83
- #{fetch(:sidekiqctl)} quiet #{pid_file}
84
- else
85
- echo 'Skip quiet command (no pid file found)'
86
- fi
87
- }.strip
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
- for_each_process do |pid_file, idx|
96
- command %{
97
- if [ -f #{pid_file} ] && kill -0 `cat #{pid_file}`> /dev/null 2>&1; then
98
- cd #{fetch(:current_path)}
99
- #{fetch(:sidekiqctl)} stop #{pid_file} #{fetch(:sidekiq_timeout)}
100
- else
101
- echo 'Skip stopping sidekiq (no pid file found)'
102
- fi
103
- }.strip
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
- for_each_process do |pid_file, idx|
112
- sidekiq_concurrency = fetch(:sidekiq_concurrency)
113
- concurrency_arg = if sidekiq_concurrency.nil?
114
- ""
115
- else
116
- "-c #{sidekiq_concurrency}"
117
- end
118
- in_path(fetch(:current_path)) do
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
@@ -1,5 +1,5 @@
1
1
  module MinaSidekiq
2
2
  def self.version
3
- '1.0.0'
3
+ '1.0.1'
4
4
  end
5
5
  end
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.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
@@ -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
- # this line is disabled because of a bug in mina 1.0.0
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.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-10-10 00:00:00.000000000 Z
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.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.0
26
+ version: 1.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry-byebug
29
29
  requirement: !ruby/object:Gem::Requirement