Vercel old preview deployments
Asked Answered
U

3

7

I really like to deploy apps on Vercel. I do however wonder how one is supposed to deal with all the preview deployments that inevitably will get created.

Are you supposed to delete them yourself? Is there a way to automate deletion of preview deployments after a certain amount of time?

Unlisted answered 26/4, 2021 at 12:50 Comment(0)
W
3

Update August 2024:

You can set a retention policy for deployments so they automatically delete after a certain age.

Previous Answer:

Preview deployments are not indexed by search engines.

If you want to make sure no one outside your organization can access preview deployments, you can enable password protection for your project.

Weasand answered 3/5, 2021 at 0:7 Comment(5)
would still like to be able to control when they are deleted :)Unlisted
Totally agree here, @FabianBosler. Were you able to figure out in the end?Polyandrous
If you're working with a database, however, I'd be worried that an old deployment might function in a way that destroys data or inserts/updates records improperly according to the latest spec (more of a problem for NoSQL); anyone on your team could open up an old deployment and cause issues. I wonder if there's a general Vercel-recommended way to deal with that...Carvey
@Weasand I just realized that one of our apps has hundred (maybe thousands) of preview deployments. I don't think we are getting billed for all this but wouldn't it make sense for Vercel to allow the configuration of a retention policy?Honeydew
Thanks for the answer, but "no need" is wrong. e.g. what if you commit a version of your app that has a glaring security vulnerability, then that is going to exist on the internet FOREVER. Even though it's pretty unlikely someone will guess the url and then exploit the vulnerability it still makes me uncomfortable.Waldon
I
2

You can use this in CLI:

vercel rm <APP> --safe
Insignificant answered 18/10, 2021 at 1:4 Comment(2)
Can you explain what this does?Mclaurin
@Mclaurin scans your project and deletes the deployment you specify instead of <APP> e.g. vercel rm yourprojectname-64v3upi73-youruser.vercel.app --safeMagi
M
1

You can now configure the retention period for Vercel deployments through the dashboard and CLI.

For example, canceled and errored deployments might be set to 30 days retention, while production deployments might be set to 1 year. Recently deleted deployments are shown in your project settings and can be instantly restored within 30 days of deletion.

https://vercel.com/changelog/configure-retention-periods-for-deployments

Masterful answered 23/8 at 14:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.