LoginSignup
47
54

More than 5 years have passed since last update.

Heroku CLI 簡単リファレンス

Last updated at Posted at 2015-09-02

ログインする

$ heroku login

アプリケーションを作る

$ heroku apps:create <app name> # アプリケーションを作る

アプリケーションの名前を変える

$ heroku rename <new app name> # 必要に応じて、--app <app name>を付ける

既存のアプリケーションを登録する

$ heroku git:remote -a <app name>

状態を確認する

$ heroku apps:info # アプリケーションの情報を見る
$ heroku ps # プロセスを見る
$ heroku logs # ログを見る

データベース等を追加する

$ heroku addons:create <db type> # RedisのFreeプランなら'heroku-redis:hobby-dev'

アプリケーションにコマンドを使う

$ heroku run <command>

Herokuの環境変数を設定する

$ heroku config:set <EXAMPLE>=<example> # 解除するには'config:unset'
$ heroku config # 環境変数の一覧を表示する

デプロイする

$ git push heroku master

メンテナンスモードにする

$ heroku maintenance:on # offにするには、maintenance:off

プロセスを停止する

$ heroku ps:stop <process name> # 指定したプロセスを停止する

再起動する

$ heroku restart <process name> # 指定したプロセスを再起動する

その他に抑えておきたいこと

  • 無料プランでもAddonsの利用にはクレジットカードの登録がいる
47
54
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
47
54