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

[8.x](backport #42304) Allow use of version qualifier for staging artifacts #42319

Merged
merged 1 commit into from
Jan 16, 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
15 changes: 9 additions & 6 deletions .buildkite/packaging.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ steps:
key: start-gate-snapshot

- name: Start of concurrency group for DRA Staging
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/
# exceptionally allow building staging from main when VERSION_QUALIFIER is set, to allow prerelease testing
# TODO remove OR clause below and above comment, and only allow matching /^[0-9]+\.[0-9x]+\$/ for build.branch
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null
command: echo "--> Start of concurrency gate dra-staging"
concurrency_group: "dra-gate-staging-$BUILDKITE_BRANCH"
concurrency: 1
Expand Down Expand Up @@ -58,7 +60,8 @@ steps:
- build/distributions/**/*

- label: Staging dashboards
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/
# TODO remove OR clause below (see earlier comment)
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null
depends_on: start-gate-staging
key: dashboards-staging
# TODO: container with go and make
Expand Down Expand Up @@ -171,8 +174,8 @@ steps:
- group: Packaging Staging
key: packaging-staging
depends_on: start-gate-staging
## Only for release
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/
# TODO remove OR clause below (see earlier comment)
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null
steps:
- label: "STAGING: {{matrix}}"
env:
Expand Down Expand Up @@ -278,8 +281,8 @@ steps:
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"

- label: DRA Staging
## Only for release branches
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/
# TODO remove OR clause below (see earlier comment)
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null
key: dra-staging
env:
DRA_WORKFLOW: staging
Expand Down
7 changes: 5 additions & 2 deletions .buildkite/scripts/dra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -euo pipefail
BRANCH="${DRA_BRANCH:="${BUILDKITE_BRANCH:=""}"}"

BEAT_VERSION=$(make get-version)

VERSION_QUALIFIER="${VERSION_QUALIFIER:=""}"
CI_DRA_ROLE_PATH="kv/ci-shared/release/dra-role"

function release_manager_login {
Expand Down Expand Up @@ -49,7 +49,9 @@ docker run --rm \
--commit "${BUILDKITE_COMMIT}" \
--workflow "${DRA_WORKFLOW}" \
--version "${BEAT_VERSION}" \
--artifact-set "main"
--artifact-set "main" \
--qualifier "${VERSION_QUALIFIER}"


echo "+++ :hammer_and_pick: Publishing DRA artifacts for version [$BEAT_VERSION], branch [$BRANCH], workflow [$DRA_WORKFLOW] and DRY_RUN: [$DRY_RUN]"

Expand All @@ -68,6 +70,7 @@ docker run --rm \
--workflow "${DRA_WORKFLOW}" \
--version "${BEAT_VERSION}" \
--artifact-set "main" \
--qualifier "${VERSION_QUALIFIER}" \
${DRY_RUN} | tee rm-output.txt


Expand Down
8 changes: 8 additions & 0 deletions .buildkite/scripts/packaging/prepare-release-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@
set -ueo pipefail

readonly TYPE=${1:-snapshot}
readonly VERSION_QUALIFIER="${VERSION_QUALIFIER:-""}"

# rename dependencies.csv to the name expected by release-manager.
VERSION=$(make get-version)
FINAL_VERSION=$VERSION-SNAPSHOT
if [ "$TYPE" != "snapshot" ] ; then
FINAL_VERSION=$VERSION
fi

set +e
if [[ -n "$VERSION_QUALIFIER" ]]; then
FINAL_VERSION="$FINAL_VERSION-${VERSION_QUALIFIER}"
fi
set -e

echo "Rename dependencies to $FINAL_VERSION"
mv build/distributions/dependencies.csv \
build/distributions/dependencies-"$FINAL_VERSION".csv
Expand Down
Loading