Commit 5a4febfb authored by Christopher Harm's avatar Christopher Harm

Fixing docker build context for ci builds

parent 53754a9f
Pipeline #29497 passed with stages
in 49 seconds
......@@ -15,6 +15,9 @@
package cmd
import (
"fmt"
"strings"
"git.psu.edu/k8s/devtool/config"
"git.psu.edu/k8s/devtool/environment"
"github.com/fatih/color"
......@@ -79,8 +82,14 @@ func buildCiDocker(config config.Config) error {
dockerImage := dockerRegistry + "/" + dockerRegistryNamespace + "/" + image
dockerTag := dockerImage + ":" + imageTag
dockerRootDir := "."
if idx := strings.LastIndex(dockerfile, "/"); idx != -1 {
dockerRootDir = dockerfile[:idx]
fmt.Println(dockerRootDir)
}
color.New(color.FgGreen).Printf("Building: %s\n", dockerTag)
err := environment.Run(true, "docker", "build", "-t", dockerTag, "-f", dockerfile, ".")
err := environment.Run(true, "docker", "build", "-t", dockerTag, "-f", dockerfile, dockerRootDir)
if err != nil {
return err
}
......
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