LoginSignup
2
2

More than 5 years have passed since last update.

Herokuでstatingとproductionを別アカウントで

Posted at

前提

  • Heroku Toolbelt をインストールしとく
  • 複数の Heroku アカウントを登録
  • 各アカウントでそれぞれ app 作成

やること

heroku-accounts をインストール

$ heroku plugins:install heroku-accounts

管理するアカウントを追加

staging, production 2つの名称で Heroku のアカウントを追加

メールアドレス、パスワードを入力

$ heroku accounts:add staging
$ heroku accounts:add production

確認

$ heroku accounts
* staging
  production

リモートリポジトリの名前を付ける

$ heroku create アプリ名 --remote staging

ステージングにデプロイ

$ git push stating master

rails consoleとか

$ heroku run rails c --remote staging

production アカウント

$ heroku accounts:set production

リモートリポジトリの名前を付ける

$ heroku create アプリ名 --remote production

本番にデプロイ

$ git push production master

本番に緊急パッチ当てたり

$ heroku run rails db --remote production

参考

Heroku Toolbelt で複数の Heroku アカウントを管理する

Herokuで同じアプリを複数の環境にデプロイ

2
2
0

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
2
2