capistrano-resque 0.2.2 → 0.2.3
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/Changelog.md +3 -0
- data/Gemfile.lock +14 -8
- data/README.md +8 -0
- data/lib/capistrano-resque/capistrano_integration.rb +5 -2
- data/lib/capistrano-resque/tasks/capistrano-resque.rake +5 -3
- data/lib/capistrano-resque/version.rb +1 -1
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 217a147eabc162a121acad042de466b37b07023e
         | 
| 4 | 
            +
              data.tar.gz: e7c3e255a950cd71be265f20cb751ade1b870ad9
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c962f5d4393ffbe82550656c6e439680d9b57e67a51fabe9fde8f7ad5eb11238d6edcc97699552712fd8e996ce02c6bbcf6e1ab3b6825e6bab0d742fddf7ff32
         | 
| 7 | 
            +
              data.tar.gz: 54bb52b354c20675fb1b78f9b7512efa351437dca9de0de60f7a455be673b5b411e5b2066ce9650e9ef9e916a386b20121936f94be5de13b795d37999304006e
         | 
    
        data/Changelog.md
    CHANGED
    
    | @@ -1,3 +1,6 @@ | |
| 1 | 
            +
            # 0.2.3 and newer
         | 
| 2 | 
            +
            * Please see the [Github Releases](https://github.com/sshingler/capistrano-resque/releases) page for changelog info
         | 
| 3 | 
            +
             | 
| 1 4 | 
             
            # 0.2.2
         | 
| 2 5 | 
             
            * Start all background tasks with `nohup` to avoid `SIGHUP` problems
         | 
| 3 6 | 
             
            * Add a `:resque_verbose` option to toggle verbose output (defaults to `true`)
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -13,7 +13,7 @@ GIT | |
| 13 13 | 
             
            PATH
         | 
| 14 14 | 
             
              remote: .
         | 
| 15 15 | 
             
              specs:
         | 
| 16 | 
            -
                capistrano-resque (0.2. | 
| 16 | 
            +
                capistrano-resque (0.2.3)
         | 
| 17 17 | 
             
                  capistrano
         | 
| 18 18 | 
             
                  resque
         | 
| 19 19 | 
             
                  resque-scheduler
         | 
| @@ -21,21 +21,25 @@ PATH | |
| 21 21 | 
             
            GEM
         | 
| 22 22 | 
             
              remote: http://rubygems.org/
         | 
| 23 23 | 
             
              specs:
         | 
| 24 | 
            -
                 | 
| 24 | 
            +
                airbrussh (1.1.1)
         | 
| 25 | 
            +
                  sshkit (>= 1.6.1, != 1.7.0)
         | 
| 26 | 
            +
                capistrano (3.6.1)
         | 
| 27 | 
            +
                  airbrussh (>= 1.0.0)
         | 
| 28 | 
            +
                  capistrano-harrow
         | 
| 25 29 | 
             
                  i18n
         | 
| 26 30 | 
             
                  rake (>= 10.0.0)
         | 
| 27 | 
            -
                  sshkit ( | 
| 28 | 
            -
                 | 
| 31 | 
            +
                  sshkit (>= 1.9.0)
         | 
| 32 | 
            +
                capistrano-harrow (0.5.3)
         | 
| 29 33 | 
             
                i18n (0.7.0)
         | 
| 30 34 | 
             
                mono_logger (1.1.0)
         | 
| 31 35 | 
             
                multi_json (1.10.1)
         | 
| 32 36 | 
             
                net-scp (1.2.1)
         | 
| 33 37 | 
             
                  net-ssh (>= 2.6.5)
         | 
| 34 | 
            -
                net-ssh (2. | 
| 38 | 
            +
                net-ssh (3.2.0)
         | 
| 35 39 | 
             
                rack (1.5.2)
         | 
| 36 40 | 
             
                rack-protection (1.5.3)
         | 
| 37 41 | 
             
                  rack
         | 
| 38 | 
            -
                rake ( | 
| 42 | 
            +
                rake (11.3.0)
         | 
| 39 43 | 
             
                redis (3.1.0)
         | 
| 40 44 | 
             
                redis-namespace (1.5.1)
         | 
| 41 45 | 
             
                  redis (~> 3.0, >= 3.0.4)
         | 
| @@ -50,8 +54,7 @@ GEM | |
| 50 54 | 
             
                  rack (~> 1.4)
         | 
| 51 55 | 
             
                  rack-protection (~> 1.4)
         | 
| 52 56 | 
             
                  tilt (~> 1.3, >= 1.3.4)
         | 
| 53 | 
            -
                sshkit (1. | 
| 54 | 
            -
                  colorize (>= 0.7.0)
         | 
| 57 | 
            +
                sshkit (1.11.3)
         | 
| 55 58 | 
             
                  net-scp (>= 1.1.2)
         | 
| 56 59 | 
             
                  net-ssh (>= 2.8.0)
         | 
| 57 60 | 
             
                thread_safe (0.3.4)
         | 
| @@ -68,3 +71,6 @@ DEPENDENCIES | |
| 68 71 | 
             
              capistrano-resque!
         | 
| 69 72 | 
             
              resque!
         | 
| 70 73 | 
             
              resque-scheduler
         | 
| 74 | 
            +
             | 
| 75 | 
            +
            BUNDLED WITH
         | 
| 76 | 
            +
               1.13.4
         | 
    
        data/README.md
    CHANGED
    
    | @@ -63,6 +63,14 @@ The above will start five workers in total: | |
| 63 63 | 
             
             * one listening on the `search_index, cache_warming` queue
         | 
| 64 64 | 
             
             * three listening on the `mailing` queue
         | 
| 65 65 |  | 
| 66 | 
            +
            If you need to pass arbitrary data (like other non-standard environment variables) to the "start" command, you can specify:
         | 
| 67 | 
            +
             | 
| 68 | 
            +
            ```ruby
         | 
| 69 | 
            +
            set :resque_extra_env, "SEARCH_SERVER=172.18.0.52"
         | 
| 70 | 
            +
            ```
         | 
| 71 | 
            +
             | 
| 72 | 
            +
            This can be useful for customizing Resque tasks in complex server environments.
         | 
| 73 | 
            +
             | 
| 66 74 | 
             
            ### Multiple Servers/Roles
         | 
| 67 75 |  | 
| 68 76 | 
             
            You can also start up workers on multiple servers/roles:
         | 
| @@ -7,12 +7,14 @@ module CapistranoResque | |
| 7 7 | 
             
                  capistrano_config.load do
         | 
| 8 8 |  | 
| 9 9 | 
             
                    _cset(:workers, {"*" => 1})
         | 
| 10 | 
            +
                    _cset(:resque_extra_env, "")
         | 
| 10 11 | 
             
                    _cset(:resque_kill_signal, "QUIT")
         | 
| 11 12 | 
             
                    _cset(:interval, "5")
         | 
| 12 13 | 
             
                    _cset(:resque_environment_task, false)
         | 
| 13 14 | 
             
                    _cset(:resque_log_file, "/dev/null")
         | 
| 14 15 | 
             
                    _cset(:resque_verbose, true)
         | 
| 15 16 | 
             
                    _cset(:resque_pid_path) { File.join(shared_path, 'tmp', 'pids') }
         | 
| 17 | 
            +
                    _cset(:resque_dynamic_schedule, false)
         | 
| 16 18 |  | 
| 17 19 | 
             
                    def rails_env
         | 
| 18 20 | 
             
                      fetch(:resque_rails_env, fetch(:rails_env, "production"))
         | 
| @@ -45,7 +47,7 @@ module CapistranoResque | |
| 45 47 | 
             
                    end
         | 
| 46 48 |  | 
| 47 49 | 
             
                    def start_command(queue, pid)
         | 
| 48 | 
            -
                      "cd #{current_path} && RAILS_ENV=#{rails_env} QUEUE=\"#{queue}\" \
         | 
| 50 | 
            +
                      "cd #{current_path} && RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} #{resque_extra_env} QUEUE=\"#{queue}\" \
         | 
| 49 51 | 
             
                       PIDFILE=#{pid} BACKGROUND=yes \
         | 
| 50 52 | 
             
                       #{"VERBOSE=1 " if fetch(:resque_verbose)}\
         | 
| 51 53 | 
             
                       INTERVAL=#{interval} \
         | 
| @@ -76,10 +78,11 @@ module CapistranoResque | |
| 76 78 | 
             
                    end
         | 
| 77 79 |  | 
| 78 80 | 
             
                    def start_scheduler(pid)
         | 
| 79 | 
            -
                      "cd #{current_path} && RAILS_ENV=#{rails_env} \
         | 
| 81 | 
            +
                      "cd #{current_path} && RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} #{resque_extra_env} \
         | 
| 80 82 | 
             
                       PIDFILE=#{pid} BACKGROUND=yes \
         | 
| 81 83 | 
             
                       #{"VERBOSE=1 " if fetch(:resque_verbose)}\
         | 
| 82 84 | 
             
                       MUTE=1 \
         | 
| 85 | 
            +
                       #{"DYNAMIC_SCHEDULE=yes " if fetch(:resque_dynamic_schedule)}\
         | 
| 83 86 | 
             
                       nohup #{fetch(:bundle_cmd, "bundle")} exec rake \
         | 
| 84 87 | 
             
                       #{"environment " if fetch(:resque_environment_task)}\
         | 
| 85 88 | 
             
                       resque:scheduler #{output_redirection}"
         | 
| @@ -1,12 +1,14 @@ | |
| 1 1 | 
             
            namespace :load do
         | 
| 2 2 | 
             
              task :defaults do
         | 
| 3 3 | 
             
                set :workers, {"*" => 1}
         | 
| 4 | 
            +
                set :resque_extra_env, ""
         | 
| 4 5 | 
             
                set :resque_kill_signal, "QUIT"
         | 
| 5 6 | 
             
                set :interval, "5"
         | 
| 6 7 | 
             
                set :resque_environment_task, false
         | 
| 7 8 | 
             
                set :resque_log_file, "/dev/null"
         | 
| 8 9 | 
             
                set :resque_verbose, true
         | 
| 9 10 | 
             
                set :resque_pid_path, -> { File.join(shared_path, 'tmp', 'pids') }
         | 
| 11 | 
            +
                set :resque_dynamic_schedule, false
         | 
| 10 12 | 
             
              end
         | 
| 11 13 | 
             
            end
         | 
| 12 14 |  | 
| @@ -69,7 +71,7 @@ namespace :resque do | |
| 69 71 | 
             
                      number_of_workers.times do
         | 
| 70 72 | 
             
                        pid = "#{fetch(:resque_pid_path)}/resque_work_#{worker_id}.pid"
         | 
| 71 73 | 
             
                        within current_path do
         | 
| 72 | 
            -
                          execute :nohup, %{#{SSHKit.config.command_map[:rake]} RAILS_ENV=#{rails_env} QUEUE="#{queue}" PIDFILE=#{pid} BACKGROUND=yes #{"VERBOSE=1 " if fetch(:resque_verbose)}INTERVAL=#{fetch(:interval)} #{"environment " if fetch(:resque_environment_task)}resque:work #{output_redirection}}
         | 
| 74 | 
            +
                          execute :nohup, %{#{SSHKit.config.command_map[:rake]} RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} #{fetch(:resque_extra_env)} QUEUE="#{queue}" PIDFILE=#{pid} BACKGROUND=yes #{"VERBOSE=1 " if fetch(:resque_verbose)}INTERVAL=#{fetch(:interval)} #{"environment " if fetch(:resque_environment_task)}resque:work #{output_redirection}}
         | 
| 73 75 | 
             
                        end
         | 
| 74 76 | 
             
                        worker_id += 1
         | 
| 75 77 | 
             
                      end
         | 
| @@ -129,7 +131,7 @@ namespace :resque do | |
| 129 131 | 
             
                    create_pid_path
         | 
| 130 132 | 
             
                    pid = "#{fetch(:resque_pid_path)}/scheduler.pid"
         | 
| 131 133 | 
             
                    within current_path do
         | 
| 132 | 
            -
                      execute :nohup, %{#{SSHKit.config.command_map[:rake]} RAILS_ENV=#{rails_env} PIDFILE=#{pid} BACKGROUND=yes #{"VERBOSE=1 " if fetch(:resque_verbose)}MUTE=1 #{"environment " if fetch(:resque_environment_task)}resque:scheduler #{output_redirection}}
         | 
| 134 | 
            +
                      execute :nohup, %{#{SSHKit.config.command_map[:rake]} RACK_ENV=#{rails_env} RAILS_ENV=#{rails_env} #{fetch(:resque_extra_env)} PIDFILE=#{pid} BACKGROUND=yes #{"VERBOSE=1 " if fetch(:resque_verbose)}MUTE=1 #{"DYNAMIC_SCHEDULE=yes " if fetch(:resque_dynamic_schedule)}#{"environment " if fetch(:resque_environment_task)}resque:scheduler #{output_redirection}}
         | 
| 133 135 | 
             
                    end
         | 
| 134 136 | 
             
                  end
         | 
| 135 137 | 
             
                end
         | 
| @@ -144,10 +146,10 @@ namespace :resque do | |
| 144 146 | 
             
                  end
         | 
| 145 147 | 
             
                end
         | 
| 146 148 |  | 
| 149 | 
            +
                desc "Restart resque scheduler"
         | 
| 147 150 | 
             
                task :restart do
         | 
| 148 151 | 
             
                  invoke "resque:scheduler:stop"
         | 
| 149 152 | 
             
                  invoke "resque:scheduler:start"
         | 
| 150 153 | 
             
                end
         | 
| 151 154 | 
             
              end
         | 
| 152 155 | 
             
            end
         | 
| 153 | 
            -
             | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: capistrano-resque
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Steven Shingler
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2016-10-17 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: capistrano
         | 
| @@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 89 89 | 
             
                  version: '0'
         | 
| 90 90 | 
             
            requirements: []
         | 
| 91 91 | 
             
            rubyforge_project: 
         | 
| 92 | 
            -
            rubygems_version: 2. | 
| 92 | 
            +
            rubygems_version: 2.6.7
         | 
| 93 93 | 
             
            signing_key: 
         | 
| 94 94 | 
             
            specification_version: 4
         | 
| 95 95 | 
             
            summary: Resque integration for Capistrano
         |