|
69 | 69 | runtimeVersion string // A runtime version which will be applied to tests that do not explicilty set a version.
|
70 | 70 | runtimeName string // The name of the runtime (aka the language name such as 'go' or 'dotnet'). Used to properly set GOOGLE_RUNTIME.
|
71 | 71 | specialChars = regexp.MustCompile("[^a-zA-Z0-9]+")
|
| 72 | + buildEnv string // The build environment (dev, qual, or prod). |
72 | 73 | )
|
73 | 74 |
|
74 | 75 | type requestType string
|
@@ -105,7 +106,7 @@ func DefineFlags() {
|
105 | 106 | flag.BoolVar(&cloudbuild, "cloudbuild", false, "Use cloudbuild network; required for Cloud Build.")
|
106 | 107 | flag.StringVar(&runtimeVersion, "runtime-version", "", "A default runtime version which will be applied to the tests that do not explicitly set a version.")
|
107 | 108 | 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.") |
109 | 110 | }
|
110 | 111 |
|
111 | 112 | // 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
|
933 | 934 | // value ensures that the generated builder sha is unique and removing it after one build will
|
934 | 935 | // not affect other builds running concurrently.
|
935 | 936 | args = append(args, "--env", "GOOGLE_RANDOM="+randString(8), "--env", "GOOGLE_DEBUG=true")
|
936 |
| - args = append(args, "--network", "host") |
937 | 937 | 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 | + } |
938 | 941 | log.Printf("Running %v\n", args)
|
939 | 942 | return args
|
940 | 943 | }
|
|
0 commit comments