Skip to content

Commit

Permalink
[8.13](backport elastic#39176) Trigger the monorepo trigger only on PR (
Browse files Browse the repository at this point in the history
elastic#39190)

Fix the Beats main pipeline to work when running on merge commits on branches as well as pull requests.

(cherry picked from commit 272b5c7)

Co-authored-by: Alexandros Sapranidis <[email protected]>
  • Loading branch information
mergify[bot] and alexsapran authored Apr 25, 2024
1 parent 0e445ba commit 39d7ad7
Showing 1 changed file with 136 additions and 0 deletions.
136 changes: 136 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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}"

0 comments on commit 39d7ad7

Please sign in to comment.