Sha256: edf18ce526fcb19ac756ee071747b5d051d5ffb049e01b655a99e6409eb596c8

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

namespace :puma do
  desc 'Start puma'
  task :start do
    on roles :app do
      within release_path do
        execute :bundle, "exec puma -C config/puma.rb -b 'unix://#{shared_path}/sockets/puma.sock' --pidfile #{shared_path}/pids/puma.pid -S #{state_path} -e #{fetch(:stage)} -d"
      end
    end
  end

  desc 'Stop puma'
  task :stop do
    on roles :app do
      within release_path do
        execute :bundle, "exec pumactl -S #{state_path} stop;true"
      end
    end
  end

  desc 'Restart puma'
  task :restart do
    on roles :app do
      within release_path do
        execute :bundle, "exec pumactl -S #{state_path} restart;true"
      end
    end
  end

  desc 'Phased restart puma'
  task :phased_restart do
    on roles :app do
      within release_path do
        execute :bundle, "exec pumactl -S #{state_path} phased-restart;true"
      end
    end
  end

  desc 'Cold Restart puma'
  task :cold_restart do
    invoke 'puma:stop'
    sleep 3
    invoke 'puma:start'
  end

  def state_path
    "#{shared_path}/sockets/puma.state"
  end

  before 'deploy:published', 'puma:restart'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
h2ocube_rails_puma-0.0.4 lib/capistrano/tasks/puma.cap