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

Backport #302 to 8.17: Support prereleases (#302) #305

Merged
merged 1 commit into from
Jan 30, 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
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ steps:
key: "dra-staging"
if: |
// Staging should only run when triggered from Unified Release
( build.branch =~ /^[0-9]+\.[0-9x]+\$/ && build.env("BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG") == "unified-release-staging" )
( (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null) && build.env("BUILDKITE_TRIGGERED_FROM_BUILD_PIPELINE_SLUG") == "unified-release-staging" )
steps:
- label: ":construction_worker: Build stack installers / Staging"
command: ".buildkite/scripts/build.ps1"
Expand Down
14 changes: 6 additions & 8 deletions .buildkite/scripts/dra-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,19 @@ VAULT_ROLE_ID=$(echo $DRA_CREDS | jq -r '.role_id')
VAULT_SECRET_ID=$(echo $DRA_CREDS | jq -r '.secret_id')
BRANCH="${BUILDKITE_BRANCH}"
export VAULT_ADDR VAULT_ROLE_ID VAULT_SECRET_ID
VERSION_QUALIFIER="${VERSION_QUALIFIER:=""}"

# Retrieve version value
VERSION=$(curl -s --retry 5 --retry-delay 10 "$MANIFEST_URL" | jq -r '.version')
# remove -SNAPSHOT style suffix from VERSION
VERSION=${VERSION%-*}
MANIFEST_VERSION=$(curl -s --retry 5 --retry-delay 10 "$MANIFEST_URL" | jq -r '.version')
# remove -SNAPSHOT or -alpha1 style suffix from MANIFEST_VERSION
VERSION=${MANIFEST_VERSION%-*}
export VERSION
if [[ -z $VERSION ]]; then
echo "+++ Required version property from ${MANIFEST_URL} was empty: [$VERSION]. Exiting."
exit 1
fi

if [ "$DRA_WORKFLOW" == "staging" ]; then
BEATS_MANIFEST_URL=$(curl https://artifacts-"$DRA_WORKFLOW".elastic.co/beats/latest/"$VERSION".json | jq -r '.manifest_url')
else
BEATS_MANIFEST_URL=$(curl https://artifacts-"$DRA_WORKFLOW".elastic.co/beats/latest/"$VERSION"-SNAPSHOT.json | jq -r '.manifest_url')
fi
BEATS_MANIFEST_URL=$(curl https://artifacts-"$DRA_WORKFLOW".elastic.co/beats/latest/"$MANIFEST_VERSION".json | jq -r '.manifest_url')

# Publish DRA artifacts
function run_release_manager() {
Expand All @@ -58,6 +55,7 @@ function run_release_manager() {
--version "${VERSION}" \
--artifact-set main \
--dependency beats:"${BEATS_MANIFEST_URL}" \
--qualifier "${VERSION_QUALIFIER}" \
$dry_run \
#
}
Expand Down