pixelforce_recipes 1.5 → 1.6

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: f40e55ffb256c9c468b6a0f783889e4ea4f42dca
4
- data.tar.gz: d752bcd16f3fa0017fc4f0cd732a2ddac037988f
3
+ metadata.gz: 64f4526b060f50034f0c162a5eba31076fd6ef5e
4
+ data.tar.gz: 0d3241f33aefabbd1a6ba449f52ab5b269bff811
5
5
  SHA512:
6
- metadata.gz: 441eaecd80b0c50da3e70211c4efa2a4446f1c117a3d52fd33b6801035702c19f325a9d8cd9c8b14fc42c7b455351bedea9e2674f794406664a020fc0011de20
7
- data.tar.gz: 0f1bb92ede4277bec0badf5bbb8cd9554c6419a659fc12e6e0c38fa811a729c75af738cda2f2b74e01923263ee3a0c6ec967e7623d798c1decb4e6236576e22c
6
+ metadata.gz: 62053ca4fce227f367dfb66eaa834f2a68582af12603b8eabbbb14c3d2645f01e399c694d11f9637a4de980a68991d40599552d0279eaa4907b54366aa44e53e
7
+ data.tar.gz: 820c96d215832f9073b4df3c3ebe67e917bc1e2c530244c0ac429fbeb35c6292ec9d1e2c6992d48946fe60208cefc51b5420c04118a4047fe3b4cf0b9be33287
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pixelforce_recipes (1.5)
4
+ pixelforce_recipes (1.6)
5
5
  capistrano (> 2.0.0)
6
6
 
7
7
  GEM
@@ -14,9 +14,9 @@ GEM
14
14
  i18n
15
15
  rake (>= 10.0.0)
16
16
  sshkit (>= 1.9.0)
17
- concurrent-ruby (1.1.3)
17
+ concurrent-ruby (1.1.4)
18
18
  diff-lcs (1.2.5)
19
- i18n (1.1.1)
19
+ i18n (1.4.0)
20
20
  concurrent-ruby (~> 1.0)
21
21
  net-scp (1.2.1)
22
22
  net-ssh (>= 2.6.5)
@@ -0,0 +1,22 @@
1
+ namespace :resque_scheduler do
2
+ desc "Install resque scheduler"
3
+
4
+ desc "Setup resque scheduler configuration for this application"
5
+ task :setup do
6
+ on roles(:resque) do
7
+ template "resque_scheduler_init.erb", "/tmp/resque_scheduler"
8
+ sudo "mv /tmp/resque_scheduler /etc/init.d/resque_scheduler"
9
+ sudo "chmod +x /etc/init.d/resque_scheduler"
10
+ sudo "update-rc.d resque_scheduler defaults"
11
+ end
12
+ end
13
+
14
+ %w[start stop restart].each do |command|
15
+ desc "#{command} resque_scheduler"
16
+ task command do
17
+ on roles(:resque) do
18
+ execute "/etc/init.d/resque_scheduler #{command}"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -14,7 +14,7 @@ namespace :sidekiq do
14
14
  %w[start stop restart].each do |command|
15
15
  desc "#{command} sidekiq"
16
16
  task command do
17
- on roles(:resque) do
17
+ on roles(:sidekiq) do
18
18
  execute "/etc/init.d/sidekiq #{command}"
19
19
  end
20
20
  end
@@ -0,0 +1,22 @@
1
+ if Capistrano::Configuration.instance(false)
2
+ Capistrano::Configuration.instance(true).load do |instance|
3
+ namespace :resque_scheduler do
4
+ desc "Install resque scheduler"
5
+
6
+ desc "Setup resque scheduler configuration for this application"
7
+ task :setup, roles: :resque do
8
+ template "resque_scheduler_init.erb", "/tmp/resque_scheduler"
9
+ run "#{sudo} mv /tmp/resque_scheduler /etc/init.d/resque_scheduler"
10
+ run "#{sudo} chmod +x /etc/init.d/resque_scheduler"
11
+ run "#{sudo} update-rc.d resque_scheduler defaults"
12
+ end
13
+
14
+ %w[start stop restart].each do |command|
15
+ desc "#{command} resque scheduler"
16
+ task command do
17
+ run "/etc/init.d/resque_scheduler #{command}"
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -13,7 +13,7 @@
13
13
  USER="<%= fetch(:user) %>"
14
14
  DAEMON=puma
15
15
  PROJECT_PATH="<%= fetch(:deploy_to) %>"
16
- DAEMON_OPTS="-e <%= fetch(:rails_env) %>"
16
+ DAEMON_OPTS="-e <%= fetch(:rails_env) %> -d"
17
17
  NAME=puma
18
18
  DESC="puma app for $USER"
19
19
  PID="$PROJECT_PATH/shared/pids/puma.pid"
@@ -52,4 +52,4 @@ case "$1" in
52
52
  ;;
53
53
  esac
54
54
 
55
- exit 0
55
+ exit 0
@@ -0,0 +1,49 @@
1
+ #!/bin/bash
2
+
3
+ ### BEGIN INIT INFO
4
+ # Provides: resque scheduler
5
+ # Required-Start: $local_fs $remote_fs $network $syslog
6
+ # Required-Stop: $local_fs $remote_fs $network $syslog
7
+ # Default-Start: 2 3 4 5
8
+ # Default-Stop: 0 1 6
9
+ # Short-Description: resque scheduler worker via init.d
10
+ # Description: starts resque scheduler
11
+ ### END INIT INFO
12
+
13
+ USER="deploy"
14
+ PROJECT_PATH="<%= fetch(:deploy_to) %>"
15
+ NAME="resque_scheduler"
16
+ DESC="Resque Scheduler for $USER"
17
+ PID="$PROJECT_PATH/shared/pids/resque_scheduler.pid"
18
+ LOGFILE="$PROJECT_PATH/shared/log/resque.log"
19
+ CD_TO_APP_DIR="cd $PROJECT_PATH/current"
20
+
21
+
22
+ case "$1" in
23
+ start)
24
+ START_DAEMON_PROCESS="bundle exec rake RAILS_ENV=<%= fetch(:rails_env) %> QUEUE='*' PIDFILE=$PID BACKGROUND=yes environment resque:scheduler 2>&1 > $LOGFILE"
25
+ echo -n "Starting $DESC: "
26
+ if [ `whoami` = 'root' ]; then
27
+ su - $USER -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS"
28
+ else
29
+ /bin/bash -l -c "$CD_TO_APP_DIR > /dev/null 2>&1 && $START_DAEMON_PROCESS"
30
+ fi
31
+ echo "$NAME."
32
+ ;;
33
+ stop)
34
+ STOP_DAEMON_PROCESS="test -f $PID && kill -s QUIT `cat $PID` && rm -f $PID"
35
+ echo -n "Stopping $DESC: "
36
+ if [ `whoami` = 'root' ]; then
37
+ su - $USER -c "$CD_TO_APP_DIR && $STOP_DAEMON_PROCESS"
38
+ else
39
+ /bin/bash -l -c "$CD_TO_APP_DIR && $STOP_DAEMON_PROCESS"
40
+ fi
41
+ echo "$NAME."
42
+ ;;
43
+ *)
44
+ echo "Usage: $NAME {start|stop|restart|reload}" >&2
45
+ exit 1
46
+ ;;
47
+ esac
48
+
49
+ exit 0
@@ -1,3 +1,3 @@
1
1
  module PixelforceRecipes
2
- VERSION = "1.5"
2
+ VERSION = "1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixelforce_recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.5'
4
+ version: '1.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Zhang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-14 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -87,12 +87,14 @@ files:
87
87
  - lib/pixelforce_recipes/capistrano_3_recipes/logrotate.rb
88
88
  - lib/pixelforce_recipes/capistrano_3_recipes/puma.rb
89
89
  - lib/pixelforce_recipes/capistrano_3_recipes/resque.rb
90
+ - lib/pixelforce_recipes/capistrano_3_recipes/resque_scheduler.rb
90
91
  - lib/pixelforce_recipes/capistrano_3_recipes/sidekiq.rb
91
92
  - lib/pixelforce_recipes/capistrano_3_recipes/unicorn.rb
92
93
  - lib/pixelforce_recipes/legacy_recipes/base.rb
93
94
  - lib/pixelforce_recipes/legacy_recipes/logrotate.rb
94
95
  - lib/pixelforce_recipes/legacy_recipes/puma.rb
95
96
  - lib/pixelforce_recipes/legacy_recipes/resque.rb
97
+ - lib/pixelforce_recipes/legacy_recipes/resque_scheduler.rb
96
98
  - lib/pixelforce_recipes/legacy_recipes/sidekiq.rb
97
99
  - lib/pixelforce_recipes/legacy_recipes/unicorn.rb
98
100
  - lib/pixelforce_recipes/templates/logrotate.erb
@@ -100,6 +102,7 @@ files:
100
102
  - lib/pixelforce_recipes/templates/nginx_puma_config.erb
101
103
  - lib/pixelforce_recipes/templates/puma_init.erb
102
104
  - lib/pixelforce_recipes/templates/resque_init.erb
105
+ - lib/pixelforce_recipes/templates/resque_scheduler_init.erb
103
106
  - lib/pixelforce_recipes/templates/sidekiq_init.erb
104
107
  - lib/pixelforce_recipes/templates/unicorn_init.erb
105
108
  - lib/pixelforce_recipes/version.rb