Sha256: b9dfe4b16ebea9045b2c1d5fc1ed4ded553df09dbe36c638bec5032babd0cd20

Contents?: true

Size: 792 Bytes

Versions: 1

Compression:

Stored size: 792 Bytes

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} phased-restart;true"
      end
    end
  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.1 lib/capistrano/tasks/puma.cap