[CI] Prevent duplicate serverless image build (#186164)

## 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
This commit is contained in:
Alex Szabo 2024-06-17 10:42:47 +02:00 committed by GitHub
parent f46dbfb7b8
commit f6968f3091
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 (