Skip to content

Commit 71be406

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 5158bea commit 71be406

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.buildkite/pipeline.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,28 @@ steps:
346346
- .buildkite/serverless.beats.tests.yml
347347
- .buildkite/scripts/steps/beats_tests.sh
348348
- .buildkite/hooks/pre-command
349+
<<<<<<< HEAD
350+
=======
351+
352+
# NOTE: This should help detecting issues earlier in the development cycle
353+
# See https://github.com/elastic/elastic-agent/issues/11604
354+
- label: "Trigger Elastic Agent Package"
355+
if: build.pull_request.id != null
356+
commands:
357+
- .buildkite/scripts/steps/trigger-elastic-agent-package.sh
358+
- .buildkite/scripts/steps/trigger-elastic-agent-package.sh | buildkite-agent pipeline upload
359+
if_changed:
360+
include:
361+
- .buildkite/pipeline.elastic-agent-package.yml
362+
- .buildkite/scripts/steps/package.sh
363+
- .buildkite/scripts/steps/trigger-elastic-agent-package.sh
364+
365+
# wait for CI to be done
366+
- wait: ~
367+
368+
- label: "Publish to serverless"
369+
branches: main
370+
trigger: "agentless-serverless-release"
371+
build:
372+
commit: "${BUILDKITE_COMMIT}"
373+
>>>>>>> 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)