Last active
August 23, 2019 13:40
-
-
Save tomharvey/a248800e492305bbf5ba3d56fa1e0513 to your computer and use it in GitHub Desktop.
File to start shoryuken in AWS Beanstalk environment - Puma with Ruby 2.5.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .ebextensions/shoryuken.config | |
# Based on the conversation in https://github.com/phstc/shoryuken/issues/48 | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_shoryuken": | |
mode: "000777" | |
content: | | |
APP_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir) | |
LOG_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_log_dir) | |
PID_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_pid_dir) | |
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir) | |
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir) | |
. $EB_SUPPORT_DIR/envvars | |
. $EB_SCRIPT_DIR/use-app-ruby.sh | |
cd $APP_DEPLOY_DIR | |
if [ -f $PID_DIR/shoryuken.pid ] | |
then | |
kill -TERM `cat $PID_DIR/shoryuken.pid` | |
rm -rf $PID_DIR/shoryuken.pid | |
fi | |
sleep 10 | |
bundle exec shoryuken \ | |
-R \ | |
-P $PID_DIR/shoryuken.pid \ | |
-C $APP_DEPLOY_DIR/config/shoryuken.yml \ | |
-L $LOG_DIR/shoryuken.log \ | |
-d | |
"/opt/elasticbeanstalk/hooks/appdeploy/pre/03_mute_shoryuken": | |
mode: "000777" | |
content: | | |
PID_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_pid_dir) | |
if [ -f $PID_DIR/shoryuken.pid ] | |
then | |
kill -USR1 `cat $PID_DIR/shoryuken.pid` | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment