Created
November 27, 2015 12:12
-
-
Save klappradla/950e29af4c595ad8c68c to your computer and use it in GitHub Desktop.
Rake tasks as post deploy hooks for AWS Elastic Beanstalk Puma-Rails applications
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
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/01_do_stuff.sh" : | |
mode: "000755" | |
owner: ec2-user | |
group: ec2-user | |
content: | | |
#! /usr/bin/env bash | |
# Using similar syntax as the appdeploy pre hooks that is managed by AWS | |
set -xe | |
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_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir) | |
. $EB_SUPPORT_DIR/envvars | |
. $EB_SCRIPT_DIR/use-app-ruby.sh | |
cd $EB_DEPLOY_DIR | |
su -c "bundle exec rake do_stuff" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for posting this man - ElasticBeanstalk is a HELL of a tool to configure. Shame on you AWS engineers who read this! This product should be EASIER and BETTER than Heroku!