oysters 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oysters/initd/delayed_job.rb +30 -0
- data/lib/oysters/templates/delayed_job_init.sh.erb +20 -0
- data/lib/oysters/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 652098cb586a45b1f5c294fb69ec1afe7684e265
|
4
|
+
data.tar.gz: 9d97d41d3fa08dfd38fb3b1ba11f78260513a89a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9de0fb6195f597dd31d312eb50268cd33fed011f8726c967f12a386eba63035ecd1dfde0854d8fefbb4d11458bb4a55da26ea66f3e35cf5c8933fce65c51cc1d
|
7
|
+
data.tar.gz: 7f96b02e513210ecc9a131b38db8bb8f5ee3589fcb9e75faac7424c12a5b8b6600eab10e631470100f53b21b2f5a7ab89d829331886ddd2bf0b3bf1c8576c7e5
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'oysters'
|
2
|
+
require 'erb'
|
3
|
+
|
4
|
+
Oysters.with_configuration do
|
5
|
+
namespace :initd do
|
6
|
+
namespace :delayed_job do
|
7
|
+
desc 'Generate delayed_job init.d script'
|
8
|
+
task :setup, roles: :app do
|
9
|
+
run "mkdir -p #{shared_path}/config"
|
10
|
+
location = File.expand_path('../../templates/delayed_job_init.sh.erb', __FILE__)
|
11
|
+
config = ERB.new(File.read(location))
|
12
|
+
text_config = config.result(binding)
|
13
|
+
put text_config, "#{shared_path}/config/#{application}_delayed_job_init.sh"
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'Copy delayed_job into an init.d and add to chkconfig'
|
17
|
+
task :install, roles: :app do
|
18
|
+
sudo "cp #{shared_path}/config/#{application}_delayed_job_init.sh /etc/init.d/#{application}_delayed_job_#{rails_env};\
|
19
|
+
sudo chmod +x /etc/init.d/#{application}_delayed_job_#{rails_env};\
|
20
|
+
sudo chkconfig --add #{application}_delayed_job_#{rails_env}", pty: true
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'Removes delayed_job from an init.d and deletes from chkconfig'
|
24
|
+
task :uninstall, roles: :app do
|
25
|
+
sudo "chkconfig --del #{application}_delayed_job_#{rails_env};\
|
26
|
+
sudo rm -f /etc/init.d/#{application}_delayed_job_#{rails_env}", pty: true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# chkconfig: 345 99 55
|
3
|
+
# description: script to start <%= application %> delayed_job
|
4
|
+
# /etc/init.d/<%= application %>_delayed_job
|
5
|
+
|
6
|
+
delayed_command() {
|
7
|
+
su - <%= user %> -c "cd <%= current_path %>; RAILS_ENV=<%= rails_env %> <%= fetch(:bundle_cmd, 'bundle') %> exec <%= delayed_job_command %> $1"
|
8
|
+
}
|
9
|
+
|
10
|
+
case "$1" in
|
11
|
+
start|stop|restart|status)
|
12
|
+
echo "calling ${1} on <%= application %> Delayed Job ... "
|
13
|
+
delayed_command "${1}"
|
14
|
+
;;
|
15
|
+
*)
|
16
|
+
echo "Usage: $0 {start|stop|restart|status}"
|
17
|
+
exit 1
|
18
|
+
esac
|
19
|
+
|
20
|
+
exit $?
|
data/lib/oysters/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oysters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Samoilov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,12 +70,14 @@ files:
|
|
70
70
|
- lib/oysters/dalli.rb
|
71
71
|
- lib/oysters/initd.rb
|
72
72
|
- lib/oysters/initd/check.rb
|
73
|
+
- lib/oysters/initd/delayed_job.rb
|
73
74
|
- lib/oysters/initd/kewatcher.rb
|
74
75
|
- lib/oysters/initd/logrotate.rb
|
75
76
|
- lib/oysters/initd/ntp.rb
|
76
77
|
- lib/oysters/initd/unicorn.rb
|
77
78
|
- lib/oysters/resque_scheduler.rb
|
78
79
|
- lib/oysters/resque_sliders.rb
|
80
|
+
- lib/oysters/templates/delayed_job_init.sh.erb
|
79
81
|
- lib/oysters/templates/kewatcher_init.sh.erb
|
80
82
|
- lib/oysters/templates/logrotate_config.erb
|
81
83
|
- lib/oysters/templates/unicorn_init.sh.erb
|
@@ -101,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
103
|
version: '0'
|
102
104
|
requirements: []
|
103
105
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.2.2
|
105
107
|
signing_key:
|
106
108
|
specification_version: 4
|
107
109
|
summary: Common capistrano recipes
|