Redeploy Heroku app without code changes

前端 未结 4 1853
一个人的身影
一个人的身影 2020-11-29 01:02

I would like to deploy a Heroku app which will be done ideally using git push -u heroku master. However this will only work if there are any pending commits to

4条回答
  •  日久生厌
    2020-11-29 01:27

    Normally setting a config var causes your application to be restarted. In most situations there should be no need to redeploy after doing this.

    If you really do need to trigger a new deployment you can add a new empty commit, then push to Heroku again:

    git commit --allow-empty -m "Trigger Heroku deploy after enabling collectstatic"
    git push heroku master
    

    The new empty commit is a regular commit. It has a hash, an author, a timestamp, etc. It will have the same tree as its parent. This should cause Heroku to build your app slug again using the same code as the previous commit.

    It's a bit awkward, but it works.

提交回复
热议问题