Sha256: 20a09a1e97cb73bc7039f0d8c535971fa96a967968a1b30034d218d0edd5f6f4

Contents?: true

Size: 1010 Bytes

Versions: 1

Compression:

Stored size: 1010 Bytes

Contents

module CapistranoDeployManagement
  module Puma
    def self.load_into(configuration)
      configuration.load do

        set(:puma_config)  { "#{current_path}/config/puma.rb" }
        set(:puma_pidfile) { "#{deploy_to}/shared/pids/puma.pid" }
        set(:puma_pid)     { "cat #{deploy_to}/shared/pids/puma.pid" }

        namespace :puma do
          desc 'Restart puma.'
          task :restart, :roles => :app, :except => {:no_release => true} do
            puma.stop
            puma.start
          end

          desc 'Start puma.'
          task :start, :roles => :app, :except => {:no_release => true} do
            run "cd #{current_path} && puma -C #{puma_pidfile}"
          end

          desc 'Stop puma.'
          task :stop, :roles => :app, :except => {:no_release => true} do
            run "test -s #{puma_pidfile} && kill $(#{puma_pid}) || echo 'puma not running. nothing to kill.'"
          end
        end

        after 'deploy:restart', 'puma:restart'

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-deploy-management-0.1.10 lib/capistrano-deploy-management/puma.rb