[Note] Update to production environment (heroku)

Premise

--I'm writing an application in Rails --Heroku CLI has been installed

Purpose of this article

--Since I made changes locally to the created application, I want to reflect the changes in the production environment with heroku ――I always forget how to push on heroku, so I want to post it instead of a memorandum

procedure

  1. Push local changes to the master branch on github
  2. Log in to heroku from the terminal

terminal


% heroku login --interactive
↓
heroku: Enter your login credentials
Email [[email protected]]: [email protected]
Password: ********
Logged in as [email protected]


It doesn't matter which directory you run it in, but I think it's safe to run it in the directory of the app you want to update.

3. Push the application to heroku

terminal


% git push heroku master
Run on the directory of the app you want to update

4. If there are any changes related to the database, also execute the following

terminal


% heroku run rails db:migrate
Run on the directory of the app you want to update

that's all.

Recommended Posts

[Note] Update to production environment [heroku]
[Note] Update to production environment (heroku)
[Note] Update to production environment (AWS EC2)
How to reflect seeds.rb in production environment
Note how to rollback Mysql deployed on Heroku
Steps to deploy to Heroku
Production environment and credentials.yml.enc
Can't upload to heroku
Deploy Vapor Project to Heroku
How to deploy on heroku
Introduction to Metabase ~ Environment Construction ~
[Note] How to write Dockerfile/docker-compose.yml
How to update with activerecord-import
[Rails] How to execute "rails db: create" etc. in production environment EC2
I want to display the images under assets/images in the production environment
[Rails] How to reset the database in production environment (Capistrano version)
AWS Cloud9 environment construction Update Ruby to the latest stable version