Skip to content

Commit 5e09240

Browse files
srinjoyraycopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 796680386 Change-Id: Iaa81988dd64e71c6c15f08b26866b7f2a84359f3
1 parent 6b406cb commit 5e09240

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/acceptance/acceptance.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ var (
6969
runtimeVersion string // A runtime version which will be applied to tests that do not explicilty set a version.
7070
runtimeName string // The name of the runtime (aka the language name such as 'go' or 'dotnet'). Used to properly set GOOGLE_RUNTIME.
7171
specialChars = regexp.MustCompile("[^a-zA-Z0-9]+")
72+
buildEnv string // The build environment (dev, qual, or prod).
7273
)
7374

7475
type requestType string
@@ -105,7 +106,7 @@ func DefineFlags() {
105106
flag.BoolVar(&cloudbuild, "cloudbuild", false, "Use cloudbuild network; required for Cloud Build.")
106107
flag.StringVar(&runtimeVersion, "runtime-version", "", "A default runtime version which will be applied to the tests that do not explicitly set a version.")
107108
flag.StringVar(&runtimeName, "runtime-name", "", "The name of the runtime (aka the language name such as 'go' or 'dotnet'). Used to properly set GOOGLE_RUNTIME.")
108-
109+
flag.StringVar(&buildEnv, "build-env", "", "The build environment to use (dev, qual, or prod). Sets GOOGLE_BUILD_ENV.")
109110
}
110111

111112
// UnarchiveTestData extracts the test-data tgz into a temp dir and returns a cleanup function to be deferred.
@@ -933,8 +934,10 @@ func buildCommand(srcDir, image, builderName, runName string, env map[string]str
933934
// value ensures that the generated builder sha is unique and removing it after one build will
934935
// not affect other builds running concurrently.
935936
args = append(args, "--env", "GOOGLE_RANDOM="+randString(8), "--env", "GOOGLE_DEBUG=true")
936-
args = append(args, "--network", "host")
937937
args = append(args, "--env", "GOOGLE_RUNTIME_IMAGE_REGION=us")
938+
if buildEnv != "" {
939+
args = append(args, "--env", fmt.Sprintf("GOOGLE_BUILD_ENV=%s", buildEnv))
940+
}
938941
log.Printf("Running %v\n", args)
939942
return args
940943
}

0 commit comments

Comments
 (0)