Skip to content

Commit

Permalink
[CI] Prevent duplicate serverless image build (#186164)
Browse files Browse the repository at this point in the history
## Summary
Only adds build_project.yml if there's not already a deploy_project.yml
added through labels

## Context
Based on the labeling logic, if we had `ci:build-serverless-image` and
`ci:project-deploy-*`, the steps for building the docker image would be
added twice.

See: https://elastic.slack.com/archives/C0D8P2XK5/p1718268306523329
  • Loading branch information
delanni authored Jun 17, 2024
1 parent f46dbfb commit f6968f3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,14 @@ const getPipeline = (filename: string, removeSteps = true) => {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/fips.yml'));
}

if (GITHUB_PR_LABELS.includes('ci:build-serverless-image')) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/build_project.yml'));
}
if (
GITHUB_PR_LABELS.includes('ci:project-deploy-elasticsearch') ||
GITHUB_PR_LABELS.includes('ci:project-deploy-observability') ||
GITHUB_PR_LABELS.includes('ci:project-deploy-security')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/deploy_project.yml'));
} else if (GITHUB_PR_LABELS.includes('ci:build-serverless-image')) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/build_project.yml'));
}

if (
Expand Down

0 comments on commit f6968f3

Please sign in to comment.