mina-sidekiq 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b00138ad54880e131c60c2d955511bbfbdd9d262
4
- data.tar.gz: f66cdab70f47c85ac99a0a7ffaaa5d04e79e3cfb
3
+ metadata.gz: f1bba161f9399c6c8cea213d7faf58b4876edb8c
4
+ data.tar.gz: 6670d52acffcb22eeefccf07a18c51b3b246b33e
5
5
  SHA512:
6
- metadata.gz: 7ce054e9deb259727dcd88232968ce6dc07d8a9cf921e3680277f3e250fa91be3fcbdb0e6146c5c957ebd8c03910e84d47eb2f18c7d48496474c3c3b5dd559e2
7
- data.tar.gz: 66ef72fcfc9521ef8e4938e285b4c1384088edf353d61c8da5b14e7538eb6f53521b0cea8e0021a267a56686b9a7e74c7297e65157e7c927bd40217b0e992d64
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
- * sidekiq: Sets the path to sidekiq.
55
- * sidekiqctl: Sets the path to sidekiqctl.
56
- * sidekiq\_timeout: Sets a upper limit of time a worker is allowed to finish, before it is killed.
57
- * sidekiq\_log: Sets the path to the log file of sidekiq
58
- * sidekiq\_pid: Sets the path to the pid file of a sidekiq worker
59
- * sidekiq_processes: Sets the number of sidekiq processes launched
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
 
@@ -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, "./config/sidekiq.yml"
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 [ -d #{deploy_to}/#{current_path} ] && [ -f #{pid_file} ] && kill -0 `cat #{pid_file}`> /dev/null 2>&1; then
81
- #{echo_cmd %{cd #{deploy_to}/#{current_path} && #{sidekiqctl} quiet #{pid_file}} }
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 'Sidekiq is not running'
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 [ -d #{deploy_to}/#{current_path} ] && [ -f #{pid_file} ] && kill -0 `cat #{pid_file}`> /dev/null 2>&1; then
96
- #{echo_cmd %[cd #{deploy_to}/#{current_path} && #{sidekiqctl} stop #{pid_file} #{sidekiq_timeout}]}
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 'Sidekiq is not running'
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
- #{echo_cmd %[cd #{deploy_to}/#{current_path}; nohup #{sidekiq} -e #{rails_env} -C #{sidekiq_config} -P #{pid_file} >> #{sidekiq_log} 2>&1 &] }
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
@@ -1,5 +1,5 @@
1
1
  module MinaSidekiq
2
2
  def self.version
3
- "0.2.0"
3
+ "0.3.0"
4
4
  end
5
5
  end
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.2.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-08-18 00:00:00.000000000 Z
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.6
72
+ rubygems_version: 2.0.7
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: Tasks to deploy Sidekiq with mina.