diff --git a/docs/appendices/0.34.0-migration-guide.md b/docs/appendices/0.34.0-migration-guide.md index 1d99c9df5..d6d157843 100644 --- a/docs/appendices/0.34.0-migration-guide.md +++ b/docs/appendices/0.34.0-migration-guide.md @@ -17,3 +17,7 @@ ```shell dokku scheduler-k3s:set --global ingress-class traefik ``` + +## Deprecations + +The `pre-deploy` plugin trigger is deprecated as of `0.34.4`. It is currently invoked during the `post-release-builder` plugin trigger, where image mutation is heavily discouraged. Users should instead move any trigger usage to the `pre-release-builder` plugin trigger. The `pre-deploy` plugin trigger will be removed in a future release. diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index 2a66d0527..9ca89d4ca 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -1934,6 +1934,9 @@ fi ### `pre-deploy` +> [!WARNING] +> Deprecated, please use `pre-release-builder` instead + - Description: Allows the running of code before the app's processes are scaled up and after the docker images are prepared. - Invoked by: `dokku deploy` - Arguments: `$APP $IMAGE_TAG` diff --git a/plugins/registry/triggers.go b/plugins/registry/triggers.go index 5579a8b74..44ec3d729 100644 --- a/plugins/registry/triggers.go +++ b/plugins/registry/triggers.go @@ -90,13 +90,16 @@ func TriggerPostDelete(appName string) error { func TriggerPostReleaseBuilder(appName string, image string) error { parts := strings.Split(image, ":") imageTag := parts[len(parts)-1] - _, err := common.CallPlugnTrigger(common.PlugnTriggerInput{ - Trigger: "pre-deploy", - Args: []string{appName, imageTag}, - StreamStdio: true, - }) - if err != nil { - return err + if common.PlugnTriggerExists("pre-deploy") { + common.LogWarn("Deprecated: please upgrade plugin to use 'pre-release-builder' plugin trigger instead of pre-deploy") + _, err := common.CallPlugnTrigger(common.PlugnTriggerInput{ + Trigger: "pre-deploy", + Args: []string{appName, imageTag}, + StreamStdio: true, + }) + if err != nil { + return err + } } imageID, _ := common.DockerInspect(image, "{{ .Id }}")