Untag extra image tag
This commit is contained in:
1 parent
dff13a8f1b
commit
881d16ea90
1 file changed
+16
-1
@@ -120,7 +120,11 @@ func pushToRegistry(appName string, tag int, imageID string, imageRepo string) e
|
|||||||
}
|
}
|
||||||
common.LogVerboseQuiet(fmt.Sprintf("Pushing %s", extraTagImage))
|
common.LogVerboseQuiet(fmt.Sprintf("Pushing %s", extraTagImage))
|
||||||
if !dockerPush(extraTagImage) {
|
if !dockerPush(extraTagImage) {
|
||||||
return errors.New(fmt.Sprintf("Unable to push image with %s tag", tag))
|
return errors.New(fmt.Sprintf("Unable to push image with %s tag", extraTag))
|
||||||
|
}
|
||||||
|
common.LogVerboseQuiet(fmt.Sprintf("Untagging extra tag %s", extraTag))
|
||||||
|
if !dockerRemoveTag(extraTagImage) {
|
||||||
|
return errors.New(fmt.Sprintf("Unable to untag extra tag %s", extraTag))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,6 +160,17 @@ func dockerTag(imageID string, imageTag string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func dockerRemoveTag(image string) bool {
|
||||||
|
cmd := sh.Command(common.DockerBin(), "image", "remove", image)
|
||||||
|
cmd.Stdout = nil
|
||||||
|
cmd.Stderr = nil
|
||||||
|
if err := cmd.Run(); err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func dockerPush(imageTag string) bool {
|
func dockerPush(imageTag string) bool {
|
||||||
cmd := sh.Command(common.DockerBin(), "image", "push", imageTag)
|
cmd := sh.Command(common.DockerBin(), "image", "push", imageTag)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
|||||||
Reference in new issue
Block a user