herokuを使う時のメモ

基本はherokuのドキュメントに全部書いてある
http://docs.heroku.com/

herokuにアップしたくない

http://docs.heroku.com/slug-compiler

test
spec
features
log
tmp

.slugignore

環境変数

http://docs.heroku.com/config-vars

# 設定
% heroku config:add KEY=VALUE

# 使う
% ENV['KEY']

# 確認
% heroku config

sequel使いたい

http://docs.heroku.com/rack#using-datamapper-or-sequel

Sequel.connect(ENV['DATABASE_URL'] || 'sqlite://my.db')
DATABASE_URL='mysql://user:pass@localhost/mydb' thin start --rackup config.ru

コマンド

# アプリ作成
% heroku create

# 名前変更
% heroku rename <newname>

# デプロイ
% git push heroku master

# migrate
% heroku rake db:migrate

# DBをサーバにプッシュ
% heroku db:push

# サーバリスタート
% heroku restart