Skip to content
mplorentz edited this page Jul 9, 2014 · 2 revisions

Heroku Branch

The Smoke Signals project maintains a heroku branch suitable for deployment to heroku.com. The heroku branch is designed to run on on Heroku's free tier, using only one web dyno. This page contains more information about using this branch on Heroku or in another environment.

Heroku Deployment

To deploy to Heroku you need to:

  1. Install the Heroku toolbelt

  2. Create a new app on Heroku (referred to as your_app): heroku create yourapp

  3. Add the Heroku Postgres :: Jade add-on: heroku addons:add heroku-postgresql:dev

  4. Create database tables: heroku pg:psql < db/schema.sql

  5. Set the environment variables, replacing the FLASK_SECRET with your own value and SMOKESIGNALS_URL with the url for your heroku app: heroku config:set FLASK_SECRET="YOUR SECRET VALUE", SMOKESIGNALS_URL="http://yourapp.herokuapp.com"

  6. Get your database's URL by running heroku config | grep POSTGRESQL and set DATABASE_URL to the same value: heroku config:set DATABASE_URL=url_from_last_command

  7. Push to Heroku: git push heroku heroku:master

  8. Fire up a dyno: heroku ps:scale web=1

  9. And you're done! You can see your app with: heroku open

Local Deployment

If you want to use the heroku branch to deploy to your own server, here is the set up you'll need to do:

# Install dependencies
pip install -r requirements.txt
gem install foreman
# Set up database
initdb db/smokesignals.db
pg_ctl -D db/smokesignals.db/ start
createdb smokesignals
psql smokesignals < db/schema.sql
# Set environment variables
export FLASK_SECRET="YOUR SECRET HERE"
export SMOKESIGNALS_URL="http://localhost:5000"
export DATABASE_URL="postgres://localhost/smokesignals"
# Start server
foreman start
Clone this wiki locally