fix(deploy): make clone installer build dependencies reliably
This commit is contained in:
@@ -177,3 +177,20 @@ func TestRootDockerInstallerIsCloneAndRunEntryPoint(t *testing.T) {
|
||||
t.Fatal("root installer must not require an operator supplied DOBOTAI_IMAGE")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRootDockerInstallerBuildsWithInternalGoModuleProxy(t *testing.T) {
|
||||
installer, err := os.ReadFile("../install-docker.sh")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
dockerfile, err := os.ReadFile("../Dockerfile")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(string(installer), "GOPROXY=https://goproxy.cn,direct") {
|
||||
t.Fatal("root installer must pass an internal default GOPROXY to docker build")
|
||||
}
|
||||
if !strings.Contains(string(dockerfile), "ARG GOPROXY") || !strings.Contains(string(dockerfile), "GOPROXY=$GOPROXY go mod download") {
|
||||
t.Fatal("Dockerfile must accept and use the root installer GOPROXY")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user