Last active
August 29, 2015 14:15
-
-
Save zetavg/9ec46f825eebadf06615 to your computer and use it in GitHub Desktop.
`bin/rake` tasks and `bin/rails console` with ease on AWS OpsWorks Instances running Passenger Rails App Server.
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
# $ curl -L http://git.io/opsrp_setapp > set-app.sh | |
# $ . set-app.sh app_name | |
# | |
# cd into app directory and sets the environment variables | |
# on AWS OpsWorks Instances running Passenger Rails App Server. | |
APP_NAME=$1 && \ | |
cd "/srv/www/${APP_NAME}/current" && \ | |
export RAILS_ENV=production && \ | |
\ | |
cat "/etc/apache2/sites-enabled/${APP_NAME}.conf" | grep 'SetEnv ' > "/tmp/${APP_NAME}_env" && \ | |
sed -i "s/ *SetEnv \"/export /g" "/tmp/${APP_NAME}_env" && \ | |
sed -i "s/\" /=/g" "/tmp/${APP_NAME}_env" && \ | |
chmod +x "/tmp/${APP_NAME}_env" && \ | |
. "/tmp/${APP_NAME}_env" |
Author
zetavg
commented
Feb 16, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment