Play frameworkをherokuで動かすための最速手順
Instant Play Framework Starterを少しづつ読み進めてるが、先にherokuに上げる方法を調べておきたくなった。公開できるとやる気出るし。基本的には公式チュートリアルで言われるがままにやっていれば動く。
環境構築(Heroku toolbelt)
heroku関連のコマンドを利用する為に必要。以前インストールしてそのまま使っているので覚えていないが、ここからダウンロードして説明読めば何とかなると思う(適当)。
herokuにログイン
mikami-no-MacBook-Air:play-starter-scala mkouhei0910$ heroku login Enter your Heroku credentials. Email: hogehoge@fugafuga Password (typing will be hidden): ... Authentication successful.
各種ファイルの作成
conf/dependencies.yml
使っているPlayのバージョンに合わせて記述する。
# Application dependencies require: - play 2.1.1
公開
gitに登録
$ git init $ git add . $ git commit -m "init"
デプロイ
$ heroku create ... $ git push heroku master ... $ heroku ps:scale web=1
確認
あとは実際にアクセスして確認する。以下のコマンドでブラウザから開く事ができる。
$ heroku open