Sha256: a280cd8adb4d15a48d9c17b8aaa4006758573c4065275b697a318cfb2fb644fb

Contents?: true

Size: 1.31 KB

Versions: 29

Compression:

Stored size: 1.31 KB

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_config}"
            # TODO: fix hardcoded port setting by using a config file
            # run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec rails s puma --port 3005 --pidfile #{puma_pidfile} -e #{rails_env}"
            run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec rails s puma --port 3005 -e #{rails_env}"
          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

29 entries across 29 versions & 1 rubygems

Version Path
capistrano-deploy-management-0.1.47 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.46 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.45 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.44 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.43 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.42 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.41 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.40 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.39 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.38 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.37 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.36 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.35 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.34 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.33 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.32 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.31 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.30 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.29 lib/capistrano-deploy-management/puma.rb
capistrano-deploy-management-0.1.28 lib/capistrano-deploy-management/puma.rb