Skip to content

Instantly share code, notes, and snippets.

@chrisconley
Created August 20, 2012 19:38
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 chrisconley/3407100 to your computer and use it in GitHub Desktop.
Save chrisconley/3407100 to your computer and use it in GitHub Desktop.
Deploying Twitter's Clockwork Raven to Heroku
# Make sure we're using Ruby 1.9.3 and checkout the heroku-demo branch of our fork
rvm use 1.9.3
git clone git://github.com/chrisconley/clockworkraven.git my-raven
cd my-raven/
git checkout heroku-demo
# Create the heroku app and add the Redis and Mysql add-ons
heroku create
heroku addons:add redistogo:nano
heroku addons:add cleardb:ignite
# Copy the value of CLEARDB_DATABASE_URL and set DATABASE_URL with it
heroku config | grep CLEARDB_DATABASE_URL
# Make sure to change the protocol from `mysql://` to `mysql2://`
heroku config:add DATABASE_URL='mysql2://aaaaaaa:aaaaaaa@us-cdbr-east.cleardb.com/heroku_aaaaaa?reconnect=true'
# Now we need to set a few environment variables for the app to run
# copy the secret key generated from `rake secret`
rake secret
# and set the SECRET_TOKEN with it
heroku config:add SECRET_TOKEN=3688f877842a0e9324c14ea558268290
# Set your AWS credentials from https://portal.aws.amazon.com/gp/aws/securityCredentials#access_credentials
heroku config:add AWS_KEY_ID=[your_key_id]
heroku config:add AWS_KEY=[your_key]
# Deploy the app to heroku
git push heroku heroku-demo:master
# Scale up our background worker needed to send tasks to Mturk
heroku scale worker=1
# Bootstrap the db
heroku run rake db:structure:load
# Add our first user
heroku run rake users:add
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment