Skip to content

Instantly share code, notes, and snippets.

@tarom
Created March 2, 2015 12:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tarom/e99fa97c3916c6717baa to your computer and use it in GitHub Desktop.
Save tarom/e99fa97c3916c6717baa to your computer and use it in GitHub Desktop.
Elastic Beanstalk 上で `rails console` 動かす用
set -xe
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_APP_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
. $EB_SUPPORT_DIR/envvars
. $EB_SCRIPT_DIR/use-app-ruby.sh
cd $EB_APP_DEPLOY_DIR
su -s /bin/bash -c "bundle exec rails console production" $EB_APP_USER
@tarom
Copy link
Author

tarom commented Mar 2, 2015

> sudo eb-rails-console.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment