0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Herokuデプロイ 流れメモ

Last updated at Posted at 2021-05-22

背景

毎回Herokuデプロイする流れをメモ。

使用技術

  • Ruby 2.6.7
  • Rails 6.0.3.6
  • MySQL 5.6.51

流れ

  • (リモートリポジトリとローカルリポジトリのデータを一致させておく)
    • ローカル→リモート: git push
    • リモート→ローカル:
      • リモート→ローカル(origin/master): git fetch origin master
      • origin/master→master: git merge origin/master
  • Herokuへpush
    • git push heroku
  • DBをリセット
    • heroku run rails db:migrate:reset RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1
  • マイグレーション
    • heroku run rails db:migrate
  • シード
    • heroku run rails db:seed
  • デプロイ状態を確認
    • heroku open

所感

個人的に有用だと思うのは、DBリセットのコマンド。
かなりググって探り当てたコマンドなので、ありがたみが深い。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?