Release phase script
complete
C
Christian Stefanescu
I would like to have an easy way to run certain things right before something gets deployed, similar to the "release phase" on Heroku (https://devcenter.heroku.com/articles/release-phase). I'm thinking of migrating the db or uploading assets.
Log In
Stephen Barlow
complete
The pre-deploy command is now generally available for all Render accounts and teams.
You can set a pre-deploy command for paid web services, private services, and background workers (including for services that deploy a prebuilt docker image).
Note that while running, pre-deploy commands count toward your allotment of pipeline minutes (formerly build minutes).
More on deploy steps: https://render.com/docs/deploys#deploy-steps
Stephen Barlow
complete
The pre-deploy command is now generally available for all Render accounts and teams.
You can set a pre-deploy command for paid web services, private services, and background workers (including for services that deploy a prebuilt docker image).
Note that while running, pre-deploy commands count toward your allotment of pipeline minutes (formerly build minutes).
More on deploy steps: https://render.com/docs/deploys#deploy-steps
D
Dejan Svetec
Stephen Barlow
preDeployCommand
and dockerCommand
can have up to a one-minute gap between their executions. I planned to use this command for running migrations, but the gap would lead to errors for our users when running migrations with breaking changes, until new instances are up (as the code changes need to catch up). This severely limits the usability of this command.
In contrast, Heroku has no noticeable gap. Are there any plans to improve this?
Stephen Barlow
Dejan Svetec: Thanks for the feedback—I'll follow up over email to better understand the issue you're encountering.
D
Dejan Svetec
Stephen Barlow are there any plans for getting this to also work with services that use Docker?
Stephen Barlow
Dejan Svetec: This does indeed also work with Docker-based services! The field appears in the Deploy section of your service's Settings page after you enable the feature from the Early Access section of your Account / Team Settings.
D
Dejan Svetec
Stephen Barlow: Got it working now, thanks.
Stephen Barlow
This functionality is now available in early access! We call it the
pre-deploy command
. Enable it from the Early Access section of your Account or Team Settings page.After enabling, you can specify a service's pre-deploy command in the Render Dashboard alongside build and start commands.
You can set a pre-deploy command for paid web services, private services, and background workers. Note that while running, pre-deploy commands count toward your allotment of build minutes.
More on deploy steps: https://render.com/docs/deploys#deploy-steps
S
Scotty Eckenthal
(Hate to be THAT commenter, but....)
...any chance y'all have a planned release date for this feature? Stoked that it's in progress and would love to plan around it. We're hoping to use this feature to automate migrations upon deploy and would prefer not to roll our own solution.
Sorry to bug - thanks in advance.
M
Meagan Gamache
Scotty Eckenthal: Hi Scotty! We're so glad to hear you're looking forward to this feature. It's in active development right now, and we're expecting to release it in the next 1-2 months. Will keep you posted!
S
Scotty Eckenthal
Meagan Gamache Thanks for the head's up - appreciate it.
Anurag Goel
in progress
D
Dejan Svetec
This is such an essential feature that would make the migration from Heroku much easier.
I'm currently running migrations as part of
dockerCommand
, but I can't have migrations run multiple times when having multiple instances (manually or with auto-scaling). I'm currently managing this with a hacky script, but it's far from ideal.I know that I could alternatively call migrations in my Dockerfile, but that would apply them 1-2 minutes before the release is live, during which customers would get errors.
C
Conor McLaughlin
We are also looking forward to this. Since we use Docker and can't use a simple python environment, we're unable to cleanly run our database migrations for Django as part of the release cycle and the buildCommand. We are putting it in the docker build but it is less than ideal.
R
Rich Shakespeare
This is absolutely essential - we are speaking to support about the many issues this causes for complex apps. Would be fantastic to hear where this is in the pipeline
k
kyle
This is so essential for a complex application with interdependent services. Even simply opening up the ability to build locally and then ship containers all at once would still be a major improvement over the current options.
Load More
→