Skip to content

[main](backport #42507) [8.x](backport #42503) Use centralized version qualifier #42512

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

Closed
wants to merge 1 commit into from
Closed
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
26 changes: 17 additions & 9 deletions .buildkite/packaging.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ steps:

- label: Staging dashboards
# TODO remove OR clause below (see earlier comment)
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null) || build.env('RUN_STAGING') == "true"
depends_on: start-gate-staging
key: dashboards-staging
# TODO: container with go and make
Expand All @@ -73,9 +73,10 @@ steps:
retry:
automatic:
- limit: 1
commands:
- make build/distributions/dependencies.csv
- make beats-dashboards
commands: |
source .buildkite/scripts/version_qualifier.sh
make build/distributions/dependencies.csv
make beats-dashboards
env:
SNAPSHOT: false
DEV: false
Expand Down Expand Up @@ -174,14 +175,16 @@ steps:
key: packaging-staging
depends_on: start-gate-staging
# TODO remove OR clause below (see earlier comment)
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null) || build.env('RUN_STAGING') == "true"
steps:
- label: "STAGING: {{matrix}}"
env:
PLATFORMS: "${PLATFORMS}"
SNAPSHOT: false
DEV: false
command: ".buildkite/scripts/packaging/package-dra.sh {{matrix}}"
command: |
source .buildkite/scripts/version_qualifier.sh
.buildkite/scripts/packaging/package-dra.sh {{matrix}}
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
Expand Down Expand Up @@ -214,7 +217,9 @@ steps:
PACKAGES: "docker"
SNAPSHOT: false
DEV: false
command: ".buildkite/scripts/packaging/package-dra.sh {{matrix}}"
command: |
source .buildkite/scripts/version_qualifier.sh
.buildkite/scripts/packaging/package-dra.sh {{matrix}}
agents:
provider: "aws"
imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64}"
Expand Down Expand Up @@ -244,7 +249,9 @@ steps:
PLATFORMS: "${PLATFORMS}"
SNAPSHOT: false
DEV: false
command: ".buildkite/scripts/packaging/package-dra.sh x-pack/agentbeat"
command: |
source .buildkite/scripts/version_qualifier.sh
.buildkite/scripts/packaging/package-dra.sh x-pack/agentbeat
agents:
provider: gcp
image: "${IMAGE_UBUNTU_X86_64}"
Expand Down Expand Up @@ -280,7 +287,7 @@ steps:

- label: DRA Staging
# TODO remove OR clause below (see earlier comment)
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null
if: (build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env('VERSION_QUALIFIER') != null) || build.env('RUN_STAGING') == "true"
key: dra-staging
env:
DRA_WORKFLOW: staging
Expand All @@ -289,6 +296,7 @@ steps:
- packaging-staging
- dashboards-staging
command: |
source .buildkite/scripts/version_qualifier.sh
buildkite-agent artifact download "build/**" .
.buildkite/scripts/packaging/prepare-release-manager.sh staging
.buildkite/scripts/dra.sh
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]"
Loading