Last active
August 29, 2015 14:14
-
-
Save zetavg/c970ceee0d4f4c632b4b to your computer and use it in GitHub Desktop.
`bin/rake` tasks and `bin/rails console` with ease on AWS OpsWorks Instances running Unicorn 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/opsru_setapp > set-app.sh | |
# $ . set-app.sh app_name | |
# | |
# cd into app directory and sets the environment variables | |
# on AWS OpsWorks Instances running Unicorn Rails App Server. | |
APP_NAME=$1 && \ | |
cd "/srv/www/${APP_NAME}/current" && \ | |
export RAILS_ENV=production && \ | |
cat "/srv/www/${APP_NAME}/shared/config/unicorn.conf" | grep ENV > "/tmp/${APP_NAME}_env" && \ | |
sed -i "s/ENV\['/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
Jan 25, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment