pixelforce_recipes 1.5 → 1.6
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 +4 -4
 - data/Gemfile.lock +3 -3
 - data/lib/pixelforce_recipes/capistrano_3_recipes/resque_scheduler.rb +22 -0
 - data/lib/pixelforce_recipes/capistrano_3_recipes/sidekiq.rb +1 -1
 - data/lib/pixelforce_recipes/legacy_recipes/resque_scheduler.rb +22 -0
 - data/lib/pixelforce_recipes/templates/puma_init.erb +2 -2
 - data/lib/pixelforce_recipes/templates/resque_scheduler_init.erb +49 -0
 - data/lib/pixelforce_recipes/version.rb +1 -1
 - metadata +5 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 64f4526b060f50034f0c162a5eba31076fd6ef5e
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 0d3241f33aefabbd1a6ba449f52ab5b269bff811
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 62053ca4fce227f367dfb66eaa834f2a68582af12603b8eabbbb14c3d2645f01e399c694d11f9637a4de980a68991d40599552d0279eaa4907b54366aa44e53e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 820c96d215832f9073b4df3c3ebe67e917bc1e2c530244c0ac429fbeb35c6292ec9d1e2c6992d48946fe60208cefc51b5420c04118a4047fe3b4cf0b9be33287
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            PATH
         
     | 
| 
       2 
2 
     | 
    
         
             
              remote: .
         
     | 
| 
       3 
3 
     | 
    
         
             
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                pixelforce_recipes (1. 
     | 
| 
      
 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. 
     | 
| 
      
 17 
     | 
    
         
            +
                concurrent-ruby (1.1.4)
         
     | 
| 
       18 
18 
     | 
    
         
             
                diff-lcs (1.2.5)
         
     | 
| 
       19 
     | 
    
         
            -
                i18n (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
         
     | 
| 
         @@ -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
         
     | 
    
        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. 
     | 
| 
      
 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:  
     | 
| 
      
 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
         
     |