From 39d7ad79466d8f51b29c738e3d64975415ebf891 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 11:46:49 +0300 Subject: [PATCH] [8.13](backport #39176) Trigger the monorepo trigger only on PR (#39190) Fix the Beats main pipeline to work when running on merge commits on branches as well as pull requests. (cherry picked from commit 272b5c7d46fd9da310e6944374124938c35fa7f3) Co-authored-by: Alexandros Sapranidis --- .buildkite/pipeline.yml | 136 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 00ce04b71d2..2c00f376cf2 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -2,6 +2,7 @@ steps: - label: "Trigger Auditbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -27,7 +28,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for Auditbeat" + if: build.pull_request.id == null + trigger: "auditbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger Heartbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -53,7 +62,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for Heartbeat" + if: build.pull_request.id == null + trigger: "heartbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger Filebeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -80,7 +97,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for Filebeat" + if: build.pull_request.id == null + trigger: "filebeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger x-pack/filebeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -107,7 +132,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for x-pack/filebeat" + if: build.pull_request.id == null + trigger: "beats-xpack-filebeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger Xpack/Dockerlogbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -133,7 +166,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for x-pack/dockerlogbeat" + if: build.pull_request.id == null + trigger: "beats-xpack-dockerlogbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger Metricbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -159,7 +200,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for Metricbeat" + if: build.pull_request.id == null + trigger: "beats-metricbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger x-pack/metricbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -186,7 +235,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for x-pack/metricbeat" + if: build.pull_request.id == null + trigger: "beats-xpack-metricbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger x-pack/osquerybeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -215,7 +272,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for x-pack/osquerybeat" + if: build.pull_request.id == null + trigger: "beats-xpack-osquerybeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger Xpack/Winlogbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -241,7 +306,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for Xpack/Winlogbeat" + if: build.pull_request.id == null + trigger: "beats-xpack-winlogbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger Deploy/K8S" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -262,7 +335,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for Deploy/K8S" + if: build.pull_request.id == null + trigger: "deploy-k8s" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger Libbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -287,7 +368,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for Libbeat" + if: build.pull_request.id == null + trigger: "beats-libbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger x-pack/libbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -313,7 +402,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for x-pack/libbeat" + if: build.pull_request.id == null + trigger: "beats-xpack-libbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger x-pack/auditbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -340,7 +437,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for x-pack/auditbeat" + if: build.pull_request.id == null + trigger: "beats-xpack-auditbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger x-pack/heartbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -367,7 +472,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for x-pack/heartbeat" + if: build.pull_request.id == null + trigger: "beats-xpack-heartbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger x-pack/packetbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -394,7 +507,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for x-pack/packetbeat" + if: build.pull_request.id == null + trigger: "beats-xpack-packetbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger Winlogbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -420,7 +541,15 @@ steps: - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + - label: "Triggering Build for Winlogbeat" + if: build.pull_request.id == null + trigger: "beats-winlogbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + - label: "Trigger Packetbeat" + if: build.pull_request.id != null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" @@ -445,3 +574,10 @@ steps: - BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST} - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + + - label: "Triggering Build for Packetbeat" + if: build.pull_request.id == null + trigger: "beats-packetbeat" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}"