Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main](backport #6651) use centralized version qualifier #6658

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .buildkite/pipeline.elastic-agent-binary-dra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ steps:
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env("RUN_STAGING") == "true" || build.env('VERSION_QUALIFIER') != null
steps:
- label: ":package: Build Elastic-Agent Core staging"
commands:
- .buildkite/scripts/steps/build-agent-core.sh
commands: |
source .buildkite/scripts/version_qualifier.sh
.buildkite/scripts/steps/build-agent-core.sh
key: "build-dra-staging"
artifact_paths:
- "build/distributions/**/*"
Expand All @@ -62,6 +63,7 @@ steps:

- label: ":hammer: DRA Publish Elastic-Agent Core staging"
command: |
source .buildkite/scripts/version_qualifier.sh
echo "+++ Restoring Artifacts"
buildkite-agent artifact download "build/**/*" .
echo "+++ Changing permissions for the release manager"
Expand Down
22 changes: 22 additions & 0 deletions .buildkite/scripts/version_qualifier.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

# An opinionated approach to managing the Elastic Qualifier for the DRA in a Google Bucket
# instead of using a Buildkite env variable.

if [[ -n "$VERSION_QUALIFIER" ]]; then
echo "~~~ VERSION_QUALIFIER externally set to [$VERSION_QUALIFIER]"
return 0
fi

# DRA_BRANCH can be used for manually testing packaging with PRs
# e.g. define `DRA_BRANCH="main"` under Options/Environment Variables in the Buildkite UI after clicking new Build
BRANCH="${DRA_BRANCH:="${BUILDKITE_BRANCH:=""}"}"

qualifier=""
URL="https://storage.googleapis.com/dra-qualifier/${BRANCH}"
if curl -sf -o /dev/null "$URL" ; then
qualifier=$(curl -s "$URL")
fi

export VERSION_QUALIFIER="$qualifier"
echo "~~~ VERSION_QUALIFIER set to [$VERSION_QUALIFIER]"