1

I have been deploying to a single app on heroku. I have decided to create a pipeline and I set this app as the production app. I created a new app for staging.

Which app should the local code be linked to and pushed to with git push heroku master? Is it the staging app or the production app?

Do I need to run a command to let my local repo know that I want it sent to the staging app?

Joshua Foxworth
  • 1,236
  • 1
  • 22
  • 50

1 Answers1

0

Do I need to run a command to let my local repo know that I want it sent to the staging app?

See "Heroku: Managing Multiple Environments for an App"

The command would be:

git config heroku.remote staging

Once this is set up, all heroku commands will default to the staging app.
To run a command on the production app, simply use the --remote production option.

The OP Joshua Foxworth adds in the comments:

Turns out that even after running the config command, I still had to specify the staging app.

git config heroku.remote staging 

Then:

git push staging master
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • so, I can enter git push heroku master and it will go to the staging app once I have entered this? – Joshua Foxworth Mar 18 '18 at 02:35
  • Whoops. Tried this ... even with setting the git remote to the staging app, it still deployed to the production app – Joshua Foxworth Mar 18 '18 at 02:46
  • Turns out that even after running the config command, I still had to specify the staging app. ... git config heroku.remote staging ... then ... git push staging master – Joshua Foxworth Mar 18 '18 at 03:57
  • @JoshuaFoxworth Great! I have included your comment in the answer for making that step more visible. – VonC Mar 18 '18 at 07:26