Reputation: 13642
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 be pushed to master.
How can I redeploy the app while there is nothing to push ? I tried git push -u heroku master -f
and still get the same below
Branch master set up to track remote branch master from heroku.
Everything up-to-date
PS: I also want to retain the existing app, which means I cannot make use of this answer https://stackoverflow.com/a/22043184/968442
Upvotes: 169
Views: 83558
Reputation: 385
you can easily redeploy your applicaiton via GUI by
Now go to the bottom most(on deploy page) and find section Manual Deploy
and click deploy branch
Upvotes: 0
Reputation: 29
This worked for me, it did an actual build and release without any commit, contrary to one other post that only does a release:
heroku plugins:install heroku-builds
heroku builds:create --source-url https://user:[email protected]/repos/<username>/<repo name>/tarball/master/ --app <app-name>
Upvotes: 1
Reputation: 1
For stop
the heroku
app uses :
$ heroku ps:scale web=0
And for start
it uses :
$ heroku ps:scale web=1
Upvotes: -5
Reputation: 1630
It turns out there is a neat plugin for Heroku called heroku release retry that lets you retry the last deploy without resorting to adding bad commits to your repository.
// install plugin
heroku plugins:install heroku-releases-retry
// retry release
heroku releases:retry --app {your-app}
Source: https://www.darraghoriordan.com/2019/03/02/heroku-push-failed-force-rebuild
Upvotes: 16
Reputation: 3641
You can do it from UI as well!
Heroku
dashboard and go to deploy
sectionManual deploy
optionHit Deploy Branch
button!
Note: you must have your app connected to GitHub for this option to be available (see comment from Derek below).
Upvotes: 82
Reputation: 1585
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
Upvotes: 15
Reputation: 136918
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.
Upvotes: 252