Skip to content

Commit 0e46f23

Browse files
v1vmergify[bot]
authored andcommitted
ci(packaging): let's test the packaging pipeline on PRs too (#11612)
(cherry picked from commit cffc2cd) # Conflicts: # .buildkite/pipeline.yml
1 parent 6f78a4a commit 0e46f23

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.buildkite/pipeline.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ steps:
353353
# this should help detecting issues earlier in the development cycle
354354
- label: "Trigger Serverless Beats Tests"
355355
if: build.pull_request.id != null
356+
<<<<<<< HEAD
356357
plugins:
357358
- monorepo-diff#v1.2.0:
358359
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
@@ -367,3 +368,36 @@ steps:
367368
build:
368369
commit: "${BUILDKITE_COMMIT}"
369370
branch: "${BUILDKITE_BRANCH}"
371+
=======
372+
trigger: "beats-agent-serverless-tests"
373+
build:
374+
commit: "${BUILDKITE_COMMIT}"
375+
branch: "${BUILDKITE_BRANCH}"
376+
if_changed:
377+
include:
378+
- .buildkite/serverless.beats.tests.yml
379+
- .buildkite/scripts/steps/beats_tests.sh
380+
- .buildkite/hooks/pre-command
381+
382+
# NOTE: This should help detecting issues earlier in the development cycle
383+
# See https://github.com/elastic/elastic-agent/issues/11604
384+
- label: "Trigger Elastic Agent Package"
385+
if: build.pull_request.id != null
386+
commands:
387+
- .buildkite/scripts/steps/trigger-elastic-agent-package.sh
388+
- .buildkite/scripts/steps/trigger-elastic-agent-package.sh | buildkite-agent pipeline upload
389+
if_changed:
390+
include:
391+
- .buildkite/pipeline.elastic-agent-package.yml
392+
- .buildkite/scripts/steps/package.sh
393+
- .buildkite/scripts/steps/trigger-elastic-agent-package.sh
394+
395+
# wait for CI to be done
396+
- wait: ~
397+
398+
- label: "Publish to serverless"
399+
branches: main
400+
trigger: "agentless-serverless-release"
401+
build:
402+
commit: "${BUILDKITE_COMMIT}"
403+
>>>>>>> cffc2cdff (ci(packaging): let's test the packaging pipeline on PRs too (#11612))
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Create a dynamic buildkite step for running the elastic-agent-package pipeline.
4+
#
5+
# Required environment variables:
6+
# - BUILDKITE_PULL_REQUEST
7+
# - BUILDKITE_COMMIT
8+
# - BUILDKITE_BRANCH
9+
# - BUILDKITE_PULL_REQUEST_BASE_BRANCH
10+
#
11+
12+
if [ ! -f .package-version ]; then
13+
echo ".package-version file not found!"
14+
exit 1
15+
fi
16+
17+
# No need for the snapshot but the three digits version is required
18+
BEAT_VERSION=$(jq -r .version .core_version)
19+
MANIFEST_URL=$(jq -r .manifest_url .package-version)
20+
21+
cat << EOF
22+
- label: ":pipeline: Run elastic-agent-package"
23+
trigger: "elastic-agent-package"
24+
build:
25+
message: "#${BUILDKITE_PULL_REQUEST} - Verify elastic-agent-package works"
26+
commit: "${BUILDKITE_COMMIT}"
27+
branch: "${BUILDKITE_BRANCH}"
28+
env:
29+
DRA_VERSION: "${BEAT_VERSION}"
30+
DRA_WORKFLOW: "snapshot"
31+
DRA_BRANCH: "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}"
32+
DRA_DRY_RUN: "--dry-run"
33+
MANIFEST_URL: "${MANIFEST_URL}"
34+
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: "false"
35+
EOF

0 commit comments

Comments
 (0)