Skip to content

Commit 4c395d0

Browse files
Use centralized version qualifier (#4393) (#4394)
To avoid manual invocations specifying the version qualifier for prereleases in this commit we leverage a centralized version of truth for the version qualifier. (cherry picked from commit 9c57ff4) Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
1 parent fd41330 commit 4c395d0

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.buildkite/pipeline.package.mbp.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ steps:
2121

2222
- label: "Package x86_64 staging"
2323
key: "package-x86-64-staging"
24-
command: ".buildkite/scripts/package.sh staging"
24+
command: |
25+
source .buildkite/scripts/version_qualifier.sh
26+
.buildkite/scripts/package.sh staging
2527
agents:
2628
provider: "gcp"
2729
image: "${IMAGE_UBUNTU_X86_64}"
@@ -38,7 +40,9 @@ steps:
3840

3941
- label: "Package aarch64 staging"
4042
key: "package-arm-staging"
41-
command: ".buildkite/scripts/package.sh staging"
43+
command: |
44+
source .buildkite/scripts/version_qualifier.sh
45+
.buildkite/scripts/package.sh staging
4246
agents:
4347
provider: "aws"
4448
imagePrefix: "${IMAGE_UBUNTU_ARM_64}"
@@ -63,7 +67,9 @@ steps:
6367
# details in https://github.com/elastic/ingest-dev/issues/4855
6468
if: "${FILE_EXISTS_IN_REPO} == true && (build.env('BUILDKITE_BRANCH') != 'main' || build.env('VERSION_QUALIFIER') != null)"
6569
key: "dra-staging"
66-
command: ".buildkite/scripts/dra_release.sh staging"
70+
command: |
71+
source .buildkite/scripts/version_qualifier.sh
72+
.buildkite/scripts/dra_release.sh staging
6773
agents:
6874
provider: "gcp"
6975
image: "${IMAGE_UBUNTU_X86_64}"
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
# An opinionated approach to managing the Elastic Qualifier for the DRA in a Google Bucket
4+
# instead of using a Buildkite env variable.
5+
6+
if [[ -n "$VERSION_QUALIFIER" ]]; then
7+
echo "~~~ VERSION_QUALIFIER externally set to [$VERSION_QUALIFIER]"
8+
return 0
9+
fi
10+
11+
# DRA_BRANCH can be used for manually testing packaging with PRs
12+
# e.g. define `DRA_BRANCH="main"` under Options/Environment Variables in the Buildkite UI after clicking new Build
13+
BRANCH="${DRA_BRANCH:="${BUILDKITE_BRANCH:=""}"}"
14+
15+
qualifier=""
16+
URL="https://storage.googleapis.com/dra-qualifier/${BRANCH}"
17+
if curl -sf -o /dev/null "$URL" ; then
18+
qualifier=$(curl -s "$URL")
19+
fi
20+
21+
export VERSION_QUALIFIER="$qualifier"
22+
echo "~~~ VERSION_QUALIFIER set to [$VERSION_QUALIFIER]"

0 commit comments

Comments
 (0)