Commit 1b1e0c39 authored by Andy Cobaugh's avatar Andy Cobaugh

use :devtool as a tag in all images to avoid pushing a new image into KinD on...

use :devtool as a tag in all images to avoid pushing a new image into KinD on every build, even when there are no changes
parent 87fce3c6
Pipeline #121825 passed with stage
in 24 seconds
......@@ -23,7 +23,6 @@ import (
"git.psu.edu/k8s/devtool/config"
"git.psu.edu/k8s/devtool/environment"
"github.com/fatih/color"
"github.com/google/uuid"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
......@@ -275,13 +274,9 @@ func buildDockerAndDeploy(config config.Config) error {
func buildDockerImage(deployable config.Deployable) (string, string, error) {
dockerfile := deployable.Dockerfile
image := deployable.Name
tag, err := uuid.NewRandom()
if err != nil {
color.Red("Failed to generate UUID for docker tag")
return "", "", err
}
tag := "devtool"
dockerTag := image + ":" + tag.String()
dockerTag := image + ":" + tag
dockerRootDir := "."
if idx := strings.LastIndex(dockerfile, "/"); idx != -1 {
......@@ -290,7 +285,7 @@ func buildDockerImage(deployable config.Deployable) (string, string, error) {
}
color.New(color.FgGreen).Printf("Building: %s\n", dockerTag)
err = environment.Run(true, "docker", "build", "-t", dockerTag, "-f", dockerfile, dockerRootDir)
err := environment.Run(true, "docker", "build", "-t", dockerTag, "-f", dockerfile, dockerRootDir)
if err != nil {
return "", "", err
}
......@@ -303,5 +298,5 @@ func buildDockerImage(deployable config.Deployable) (string, string, error) {
}
}
return image, tag.String(), nil
return image, tag, nil
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment