Created
March 31, 2015 16:43
-
-
Save jackcompton/a4ec784d219ff5440926 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
description "Elastic Beanstalk Puma Upstart Manager" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
script | |
exec /bin/bash <<"EOF" | |
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 | |
if grep -eq 'true' /etc/elasticbeanstalk/has_puma.txt; then | |
exec su -s /bin/bash -c "bundle exec puma -C $EB_SUPPORT_DIR/conf/pumaconf.rb" webapp | |
else | |
exec su -s /bin/bash -c "puma -C $EB_SUPPORT_DIR/conf/pumaconf.rb" webapp | |
fi | |
EOF | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment