Changes between Initial Version and Version 1 of InstallationGuidelines/Heroku


Ignore:
Timestamp:
09/12/13 12:27:18 (11 years ago)
Author:
somayjain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • InstallationGuidelines/Heroku

    v1 v1  
     1= Heroku =
     2[[TOC]]
     3
     4== Introduction ==
     5Eden can be easily deployed on heroku.
     6The initial deployment is free of cost and does not require a credit card.
     7For making the deployment scalable, and to introduce more add-ons to the deployment, appropriate pricing is available.
     8
     9More information can be found here - [https://www.heroku.com/pricing Pricing]
     10
     11== Deployment ==
     12
     13* The deployment process is very straightforward.
     14* Changes when committed and pushed to git automatically reflect in the deployment, and the application is rebuilt and redeployed.
     15
     16The following script will be useful in deploying eden on heroku -
     17
     18{{{
     19# Choose the Admin Password
     20read -p "Choose your admin password?" passwd
     21
     22# Get latest web2py
     23git clone https://github.com/web2py/web2py.git web2py
     24cd web2py/applications
     25
     26# Get latest copy of Sahana Eden.
     27git clone https://github.com/flavour/eden.git eden
     28
     29# Copy and edit the config file
     30cp eden/private/templates/000_config.py eden/models/000_config.py
     31cat eden/models/000_config.py | sed "s/FINISHED_EDITING_CONFIG_FILE = False/FINISHED_EDITING_CONFIG_FILE = True/" > temp
     32mv temp eden/models/000_config.py
     33
     34cd ..
     35
     36# Install virtualenv and postgres DB
     37sudo pip install virtualenv
     38sudo pip install psycopg2
     39
     40# Activate the virtual environment
     41virtualenv venv --distribute
     42source venv/bin/activate
     43
     44# Generate the requirements for Eden.
     45cp applications/eden/requirements.txt .
     46echo "" >> requirements.txt
     47pip freeze >> requirements.txt
     48
     49# Write the Procfile used by heroku
     50echo "web: python web2py.py -a '$passwd' -i 0.0.0.0 -p \$PORT" > Procfile
     51
     52# Create a remote for heroku
     53heroku create
     54
     55# Choose the application name
     56read -p "Choose your application name?" appname
     57heroku apps:rename $appname   
     58
     59# Remove eden from version control and add it to web2py version control (there should be one version control)
     60cd applications/eden/
     61rm -rf .git
     62git add -f .
     63cd ../../
     64git add .
     65git add Procfile
     66
     67git commit -a -m "first commit"
     68
     69# Push Eden to heroku
     70git push heroku master
     71
     72# Add add-ons : Postgres DB
     73heroku addons:add heroku-postgresql:dev --app $appname
     74heroku scale web=1 --app $appname
     75
     76# Open the application.
     77heroku open --app $appname
     78
     79}}}
     80
     81* Whenever {{{git push heroku master}}} is done with some changes, those changes are pushed into the application deployed on heroku.