Teardown hook for preview environments
Dan Wendorf
When using preview environments, the initialDeployHook allows me to set up services or data that I need for the preview environment. Sometimes, however, I would like to tear this down along with the preview environment.
It's possible to coordinate this with my service's start script, but it would be convenient to be able to define this at the level of the preview environment itself.
As an example, imagine I'm integrating with a third-party analytics tool. I might want to create a custom workspace in that tool just for my preview environment, so will send an API call like "POST https://analytics.example.com/workspace?name=pr1234" during my initialDeployHook. When the preview environment is getting deleted, I would like to clean up the workspace with a "DELETE https://analytics.example.com/workspaces/pr1234".
It would be nice to be able to specify something like a "teardownHook" that is similar to the existing "initialDeployHook".
Log In
C
Cedric Schwyter
this is not just useful, but an actual security issue in some cases - some SaaS applications provision custom CNAME DNS records to access preview environments under the app's domain. we need to be able to clean that DNS record up, as otherwise we have a DNS leak.
M
Max Fleischer
This would be very helpful for me in managing external services. Specifically for my scenario, I have an object storage bucket I duplicate on lower environments used for testing so that developers can upload/change/delete any files through the web service without affecting production. However, this bucket needs to be manually removed after the PR is merged as there is no teardown hook.
Š
Štefan Ľupták
This one would be super useful. Without this and without GitHub Deployments integration PR environments are sadly still a bit crippled.