Skip to content

Commit

Permalink
[7.17](backport elastic#38913) Move to static BK pipeline for x-pack/…
Browse files Browse the repository at this point in the history
…metricbeat (elastic#38931)

This commit refactors the x-pack/metricbeat
pipeline to the pipeline selector approach,
as laid out in elastic#38783

Relates: elastic/ingest-dev#3072
(cherry picked from commit 4f4fad6)
  • Loading branch information
mergify[bot] authored and michel-laterman committed Apr 17, 2024
1 parent 8d9412d commit 775b58b
Show file tree
Hide file tree
Showing 7 changed files with 335 additions and 346 deletions.
5 changes: 2 additions & 3 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ ENABLED_BEATS_PIPELINES_SLUGS=(
"beats-winlogbeat"
"beats-winlogbeat"
"beats-xpack-libbeat"
"beats-xpack-metricbeat"
"beats-xpack-packetbeat"
"beats-xpack-winlogbeat"
"beats-xpack-dockerlogbeat"
Expand All @@ -77,8 +76,8 @@ for slug in "${ENABLED_BEATS_PIPELINES_SLUGS[@]}"; do
fi
done

if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-metricbeat" || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-filebeat" ]]; then
if [[ "$BUILDKITE_STEP_KEY" == "extended-cloud-test" ]]; then
if [[ "$BUILDKITE_PIPELINE_SLUG" == *"xpack-metricbeat"* || "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-filebeat" ]]; then
if [[ "$BUILDKITE_STEP_KEY" == *"extended-cloud-test"* ]]; then
BEATS_AWS_SECRET_KEY=$(retry_with_count 5 vault kv get -field secret_key ${AWS_SERVICE_ACCOUNT_SECRET_PATH})
export BEATS_AWS_SECRET_KEY
BEATS_AWS_ACCESS_KEY=$(retry_with_count 5 vault kv get -field access_key ${AWS_SERVICE_ACCOUNT_SECRET_PATH})
Expand Down
27 changes: 27 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,33 @@ steps:
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}

- label: "Trigger x-pack/metricbeat"
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
watch:
- path:
- x-pack/metricbeat/
- x-pack/libbeat/common/aws
- .buildkite/x-pack/pipeline.xpack.metricbeat.yml
- .buildkite/scripts
- .buildkite/hooks/
#OSS
- go.mod
- pytest.ini
- dev-tools/
- libbeat/**
- testing/**
config:
trigger: "beats-xpack-metricbeat"
build:
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}

- label: "Trigger Xpack/Winlogbeat"
plugins:
- monorepo-diff#v1.0.1:
Expand Down
16 changes: 0 additions & 16 deletions .buildkite/pull-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,6 @@
"skip_ci_on_only_changed": [ ],
"always_require_ci_on_changed": ["^x-pack/libbeat/.*", "^.buildkite/.*", "^go.mod", "^pytest.ini", "^dev-tools/.*", "^libbeat/.*", "^testing/.*", "^x-pack/libbeat/.*"]
},
{
"enabled": true,
"pipelineSlug": "beats-xpack-metricbeat",
"allow_org_users": true,
"allowed_repo_permissions": ["admin", "write"],
"allowed_list": [ ],
"set_commit_status": true,
"build_on_commit": true,
"build_on_comment": true,
"trigger_comment_regex": "^/test x-pack/metricbeat$",
"always_trigger_comment_regex": "^/test x-pack/metricbeat$",
"skip_ci_labels": [ ],
"skip_target_branches": [ ],
"skip_ci_on_only_changed": [ ],
"always_require_ci_on_changed": ["^x-pack/metricbeat/.*", "^.buildkite/.*", "^go.mod", "^pytest.ini", "^dev-tools/.*", "^libbeat/.*", "^testing/.*", "^x-pack/libbeat/.*"]
},
{
"enabled": true,
"pipelineSlug": "beats-xpack-auditbeat",
Expand Down
4 changes: 1 addition & 3 deletions .buildkite/scripts/cloud_tests.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env bash

# What Terraform Module will run
if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-metricbeat" ]]; then
export MODULE_DIR="x-pack/metricbeat/module/aws"
elif [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-filebeat" ]]; then
if [[ "$BUILDKITE_PIPELINE_SLUG" == "beats-xpack-filebeat" ]]; then
export MODULE_DIR="x-pack/filebeat/input/awss3/_meta/terraform"
fi

Expand Down
4 changes: 0 additions & 4 deletions .buildkite/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ xpack_libbeat_changeset=(
"^x-pack/libbeat/.*"
)

xpack_metricbeat_changeset=(
"^x-pack/metricbeat/.*"
)

xpack_osquerybeat_changeset=(
"^x-pack/osquerybeat/.*"
)
Expand Down
271 changes: 0 additions & 271 deletions .buildkite/scripts/generate_xpack_metricbeat_pipeline.sh

This file was deleted.

Loading

0 comments on commit 775b58b

Please sign in to comment.