pixelforce_cms 0.9.9.7 → 0.9.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/generators/pixelforce_cms/install_generator.rb +2 -0
- data/lib/generators/pixelforce_cms/templates/recipes/delayed_job.rb +19 -0
- data/lib/generators/pixelforce_cms/templates/recipes/templates/delayed_job_init.erb +44 -0
- data/lib/pixelforce_cms/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e2ac0fa42d3c43f6f2926c9c91fda5579c6dbd9
|
4
|
+
data.tar.gz: 4bcac06799a8756ecf71a4ccb61773dd41de6b0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b4aa6dff349c3f3173c12346b5140dc1d7dedb64f57d28ad92cba0161a8b4d6ec8c75461df07a750bfb4564b80109aebbe194ebd9affb12f09788f5c7d62640
|
7
|
+
data.tar.gz: 607cc1e7857877c9937a769048bcc401403398437c91a2b062135858528aecda87351e96b3ad7c8f63ec180c5511b90d3ca4b8d0d38e9e1952c6f7ba3347e547
|
data/README.md
CHANGED
@@ -30,9 +30,11 @@ module PixelforceCms
|
|
30
30
|
copy_file "recipes/base.rb", "config/recipes/base.rb"
|
31
31
|
copy_file "recipes/unicorn.rb", "config/recipes/unicorn.rb"
|
32
32
|
copy_file "recipes/sphinx.rb", "config/recipes/sphinx.rb"
|
33
|
+
copy_file "recipes/delayed_job.rb", "config/recipes/delayed_job.rb"
|
33
34
|
copy_file "recipes/templates/nginx_config.erb", "config/recipes/templates/nginx_config.erb"
|
34
35
|
copy_file "recipes/templates/unicorn_init.erb", "config/recipes/templates/unicorn_init.erb"
|
35
36
|
copy_file "recipes/templates/sphinx_init.erb", "config/recipes/templates/sphinx_init.erb"
|
37
|
+
copy_file "recipes/templates/delayed_job_init.erb", "config/recipes/templates/delayed_job_init.erb"
|
36
38
|
end
|
37
39
|
|
38
40
|
def copy_controller_files
|
@@ -0,0 +1,19 @@
|
|
1
|
+
namespace :delayed_job do
|
2
|
+
desc "Setup delayed job"
|
3
|
+
|
4
|
+
desc "Setup delayed configuration for this application"
|
5
|
+
task :setup, roles: :web do
|
6
|
+
template "delayed_job_init.erb", "/tmp/delayed"
|
7
|
+
run "#{sudo} mv /tmp/delayed /etc/init.d/#{application}_delayed"
|
8
|
+
run "#{sudo} chmod +x /etc/init.d/#{application}_delayed"
|
9
|
+
run "#{sudo} update-rc.d #{application}_delayed defaults"
|
10
|
+
end
|
11
|
+
# after "deploy:setup", "nginx:setup"
|
12
|
+
|
13
|
+
%w[start stop reindex].each do |command|
|
14
|
+
desc "#{command} delayed"
|
15
|
+
task command, roles: :web do
|
16
|
+
run "/etc/init.d/#{application}_delayed #{command}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
USER="deploy"
|
4
|
+
PROJECT_PATH="<%= deploy_to %>"
|
5
|
+
NAME=delayed_job
|
6
|
+
DESC="Unicorn app for $USER"
|
7
|
+
export RAILS_ENV=production
|
8
|
+
PID="$PROJECT_PATH/shared/pids/delayed_job.pid"
|
9
|
+
|
10
|
+
case "$1" in
|
11
|
+
start)
|
12
|
+
CD_TO_APP_DIR="cd $PROJECT_PATH/current"
|
13
|
+
START_DAEMON_PROCESS="bundle exec ./script/delayed_job -n 1 start"
|
14
|
+
|
15
|
+
echo -n "Starting $DESC: "
|
16
|
+
if [ `whoami` = 'root' ]; then
|
17
|
+
su - $USER -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS"
|
18
|
+
else
|
19
|
+
$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS
|
20
|
+
fi
|
21
|
+
echo "$NAME."
|
22
|
+
;;
|
23
|
+
stop)
|
24
|
+
echo -n "Stopping $DESC: "
|
25
|
+
kill -QUIT `cat $PID`
|
26
|
+
echo "$NAME."
|
27
|
+
;;
|
28
|
+
restart)
|
29
|
+
echo -n "Restarting $DESC: "
|
30
|
+
kill -USR2 `cat $PID`
|
31
|
+
echo "$NAME."
|
32
|
+
;;
|
33
|
+
reload)
|
34
|
+
echo -n "Reloading $DESC configuration: "
|
35
|
+
kill -HUP `cat $PID`
|
36
|
+
echo "$NAME."
|
37
|
+
;;
|
38
|
+
*)
|
39
|
+
echo "Usage: $NAME {start|stop|restart|reload}" >&2
|
40
|
+
exit 1
|
41
|
+
;;
|
42
|
+
esac
|
43
|
+
|
44
|
+
exit 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pixelforce_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.9.
|
4
|
+
version: 0.9.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,7 +84,9 @@ files:
|
|
84
84
|
- lib/generators/pixelforce_cms/templates/pages_controller.rb
|
85
85
|
- lib/generators/pixelforce_cms/templates/pretty_url.rb
|
86
86
|
- lib/generators/pixelforce_cms/templates/recipes/base.rb
|
87
|
+
- lib/generators/pixelforce_cms/templates/recipes/delayed_job.rb
|
87
88
|
- lib/generators/pixelforce_cms/templates/recipes/sphinx.rb
|
89
|
+
- lib/generators/pixelforce_cms/templates/recipes/templates/delayed_job_init.erb
|
88
90
|
- lib/generators/pixelforce_cms/templates/recipes/templates/nginx_config.erb
|
89
91
|
- lib/generators/pixelforce_cms/templates/recipes/templates/sphinx_init.erb
|
90
92
|
- lib/generators/pixelforce_cms/templates/recipes/templates/unicorn_init.erb
|