Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Service Puma

ZeroC0D3 Team edited this page Jan 19, 2018 · 4 revisions

Puma Service

  • Running Puma
bundle exec puma -C [path_config_puma] RAILS_ENV=[environment]
  • Stop Puma
ps aux | grep -i puma | awk {'print $2'} | sudo xargs kill -9
  • Script puma_start.sh (Development / Staging Environment)
#!/usr/bin/env sh

ENV='staging'

BUNDLE=`which bundle`
PWD_PUMA=`which puma`

if [ "$ENV" = "production" ]
then
  PWD_ROOT='/home/deploy/zeroc0d3lab/current'
  CFG_PUMA='/home/deploy/zeroc0d3lab/current/config/puma/production.rb'
else
  PWD_ROOT='/home/deploy/zeroc0d3lab.dev/current'
  CFG_PUMA='/home/deploy/zeroc0d3lab.dev/current/config/puma/staging.rb'
fi

cd $PWD_ROOT
RAILS_ENV=$ENV $BUNDLE exec $PWD_PUMA -C $CFG_PUMA $PWD_ROOT/config.ru
  • Script puma_start.sh (Production Environment)
#!/usr/bin/env sh

ENV='production'

BUNDLE=`which bundle`
PWD_PUMA=`which puma`

if [ "$ENV" = "production" ]
then
  PWD_ROOT='/home/deploy/zeroc0d3lab/current'
  CFG_PUMA='/home/deploy/zeroc0d3lab/current/config/puma/production.rb'
else
  PWD_ROOT='/home/deploy/zeroc0d3lab.dev/current'
  CFG_PUMA='/home/deploy/zeroc0d3lab.dev/current/config/puma/staging.rb'
fi

cd $PWD_ROOT
RAILS_ENV=$ENV $BUNDLE exec $PWD_PUMA -C $CFG_PUMA $PWD_ROOT/config.ru
  • Running Puma with Script
./puma_start.sh
Clone this wiki locally