Redeploy Heroku app without code changes

前端 未结 4 1756
一个人的身影
一个人的身影 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.

    0 讨论(0)
  • 2020-11-29 01:29

    You can run heroku restart --app app_name and you are good to go.

    0 讨论(0)
  • 2020-11-29 01:39

    There is now also a plugin for the Heroku command-line that allows you to re-release the most recently deployed slug.

    See https://www.npmjs.com/package/heroku-releases-retry

    0 讨论(0)
  • 2020-11-29 01:45

    You can do it from UI as well!

    1. Login to your Heroku dashboard and go to deploy section
    2. Find Manual deploy option

    Hit Deploy Branch button!

    0 讨论(0)
提交回复
热议问题