From 8c42e85fccb5711267d03166b3fd3c4208fd6efe Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 14 Aug 2021 01:23:30 -0400 Subject: [PATCH] fix: move pre-deploy trigger to before image retagging --- plugins/registry/triggers.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/registry/triggers.go b/plugins/registry/triggers.go index 4699d04ee..7167c8421 100644 --- a/plugins/registry/triggers.go +++ b/plugins/registry/triggers.go @@ -56,17 +56,17 @@ func TriggerPostDelete(appName string) error { // TriggerPostReleaseBuilder pushes the image to the remote registry func TriggerPostReleaseBuilder(appName string, image string) error { - imageID, _ := common.DockerInspect(image, "{{ .Id }}") - imageRepo := common.GetAppImageRepo(appName) - computedImageRepo := reportComputedImageRepo(appName) - newImage := strings.Replace(image, imageRepo+":", computedImageRepo+":", 1) - - parts := strings.Split(newImage, ":") + parts := strings.Split(image, ":") imageTag := parts[len(parts)-1] if err := common.PlugnTrigger("pre-deploy", []string{appName, imageTag}...); err != nil { return err } + imageID, _ := common.DockerInspect(image, "{{ .Id }}") + imageRepo := common.GetAppImageRepo(appName) + computedImageRepo := reportComputedImageRepo(appName) + newImage := strings.Replace(image, imageRepo+":", computedImageRepo+":", 1) + if computedImageRepo != imageRepo { if !dockerTag(imageID, newImage) { // TODO: better error