Created
June 22, 2012 05:33
-
-
Save robzolkos/2970521 to your computer and use it in GitHub Desktop.
Heroku/S3 application creation notes
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
| gem install bundler --pre | |
| create a "appname-staging" bucket on S3 | |
| create a "appname-production" bucket on S3 | |
| rails new appname -d postgresql | |
| rvm ruby-1.9.3-p194-perf@appname --create | |
| add ruby "1.9.3" to Gemfile (2nd line) | |
| add gem 'heroku' to Gemfile | |
| add gem 'unicorn' to Gemfile | |
| create file config/unicorn.rb | |
| worker_processes 4 | |
| timeout 30 | |
| create Procfile | |
| web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb | |
| bundle | |
| **** create heroku app | |
| **** add collaborator | |
| **** heroku sharing:transfer rob@copirite.com.au | |
| heroku addons:add scheduler:standard | |
| heroku addons:open scheduler | |
| put this in Rakefile (set to run hourly) | |
| require "net/http" | |
| desc "Ping app" | |
| task :ping do | |
| url = 'my-app.herokuapp.com' | |
| puts "ping? (#{url})" | |
| r = Net::HTTP.new(url, 80).request_head('/') | |
| puts "pong! (#{r.code} #{r.message})" | |
| end | |
| git checkout -b dev | |
| heroku create --remote staging | |
| git push staging dev | |
| git checkout master | |
| heroku create --remote production | |
| git push production master | |
| heroku apps:rename appname-production --app orignal_heroku_name | |
| heroku apps:rename appname-staging --app orignal_heroku_name | |
| heroku config:add S3_KEY=key_from_amazon_s3 --remote staging | |
| heroku config:add S3_SECRET=secret_from_amazon_s3 --remote staging | |
| heroku config:add S3_KEY=key_from_amazon_s3 --remote production | |
| heroku config:add S3_SECRET=secret_from_amazon_s3 --remote production | |
| ** do some coding ** | |
| git push production master | |
| git push staging dev:master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment