LoginSignup
0
0

More than 3 years have passed since last update.

[備忘録]本番環境への更新(heroku)

Posted at

前提

  • Railsでアプリケーションを作成している
  • heroku CLIのインストールが済んでいる

本記事の目的

  • 作成したアプリケーションにローカルで変更を加えたので、herokuで本番環境にも変更を反映させたい
  • herokuでのプッシュ方法をいつも忘れてしまうので、備忘録代わりに投稿しておきたい

手順

1.ローカル環境での変更をgithub上のmasterブランチへプッシュ

2.ターミナル上からherokuへログイン

terminal
% heroku login --interactive
↓
heroku: Enter your login credentials
Email [example@example.com]: example@example.com
Password: ********
Logged in as example@example.com


どのディレクトリで実行しても問題ないが、更新したいアプリのディレクトリ上で実行するのが無難だと思う。



3.アプリケーションをherokuにプッシュする

terminal
% git push heroku master
更新したいアプリのディレクトリ上で実行



4.もしデータベース関連でも変更がある場合は以下も実行する

terminal
% heroku run rails db:migrate
更新したいアプリのディレクトリ上で実行

以上。

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