githerokuheroku-pipelines

Heroku pipeline - which app is code linked to


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?


Solution

  • 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