dev/ci: revert change that removed version from build (#26047)

This commit is contained in:
Robert Lin 2021-10-13 15:13:25 -04:00 committed by GitHub
parent 447e3f9284
commit 9ed0fb21e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -440,17 +440,19 @@ func candidateImageStepKey(app string) string {
// Build a candidate docker image that will re-tagged with the final
// tags once the e2e tests pass.
func buildCandidateDockerImage(app, tag string) operations.Operation {
//
// Version is the actual version of the code, and
func buildCandidateDockerImage(app, version, tag string) operations.Operation {
return func(pipeline *bk.Pipeline) {
image := strings.ReplaceAll(app, "/", "-")
localImage := "sourcegraph/" + image + ":buildkite-" + tag
localImage := "sourcegraph/" + image + ":" + version
cmds := []bk.StepOpt{
bk.Key(candidateImageStepKey(app)),
bk.Cmd(fmt.Sprintf(`echo "Building candidate %s image..."`, app)),
bk.Env("DOCKER_BUILDKIT", "1"),
bk.Env("IMAGE", localImage),
bk.Env("VERSION", ":buildkite-"+tag),
bk.Env("VERSION", version),
bk.Cmd("yes | gcloud auth configure-docker"),
}

View File

@ -101,7 +101,7 @@ func GeneratePipeline(c Config) (*bk.Pipeline, error) {
case BackendIntegrationTests:
ops.Append(
buildCandidateDockerImage("server", c.candidateImageTag()),
buildCandidateDockerImage("server", c.Version, c.candidateImageTag()),
backendIntegrationTests(c.candidateImageTag()))
// Run default set of PR checks as well
@ -137,7 +137,7 @@ func GeneratePipeline(c Config) (*bk.Pipeline, error) {
panic(fmt.Sprintf("no image %q found", patchImage))
}
ops = operations.NewSet([]operations.Operation{
buildCandidateDockerImage(patchImage, c.candidateImageTag()),
buildCandidateDockerImage(patchImage, c.Version, c.candidateImageTag()),
})
// Test images
ops.Merge(CoreTestOperations(nil, CoreTestOperationsOptions{}))
@ -148,7 +148,7 @@ func GeneratePipeline(c Config) (*bk.Pipeline, error) {
// If this is a no-test branch, then run only the Docker build. No tests are run.
app := c.Branch[27:]
ops = operations.NewSet([]operations.Operation{
buildCandidateDockerImage(app, c.candidateImageTag()),
buildCandidateDockerImage(app, c.Version, c.candidateImageTag()),
wait,
publishFinalDockerImage(c, app, false),
})
@ -156,7 +156,7 @@ func GeneratePipeline(c Config) (*bk.Pipeline, error) {
case CandidatesNoTest:
for _, dockerImage := range images.SourcegraphDockerImages {
ops.Append(
buildCandidateDockerImage(dockerImage, c.candidateImageTag()))
buildCandidateDockerImage(dockerImage, c.Version, c.candidateImageTag()))
}
case ExecutorPatchNoTest:
@ -171,7 +171,7 @@ func GeneratePipeline(c Config) (*bk.Pipeline, error) {
// Slow image builds
for _, dockerImage := range images.SourcegraphDockerImages {
ops.Append(buildCandidateDockerImage(dockerImage, c.candidateImageTag()))
ops.Append(buildCandidateDockerImage(dockerImage, c.Version, c.candidateImageTag()))
}
// Currently disabled due to timeouts - see https://github.com/sourcegraph/sourcegraph/issues/25487
// skipHashCompare := c.MessageFlags.SkipHashCompare || c.RunType.Is(ReleaseBranch)