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.16](backport #6551) Support VERSION_QUALIFIER for elastic-agent-core DRA #6552

Merged
merged 1 commit into from
Jan 27, 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
5 changes: 3 additions & 2 deletions .buildkite/pipeline.elastic-agent-binary-dra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ env:
steps:
- group: ":beats: DRA Elastic-Agent Core Snapshot :beats:"
key: "dra-core-snapshot"
if: build.branch == 'main' || build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env("RUN_SNAPSHOT") == "true"
# don't run snapshot builds with prereleases (non empty VERSION_QUALIFIER) unless forced (RUN_SNAPSHOT=true)
if: build.env("RUN_SNAPSHOT") == "true" || (build.env('VERSION_QUALIFIER') == null && (build.branch == 'main' || build.branch =~ /^[0-9]+\.[0-9x]+\$/))
steps:
- label: ":package: Build Elastic-Agent Core Snapshot"
commands:
Expand Down Expand Up @@ -43,7 +44,7 @@ steps:

- group: ":beats: DRA Elastic-Agent Core Staging :beats:"
key: "dra-core-staging"
if: build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env("RUN_STAGING") == "true"
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:
Expand Down
6 changes: 6 additions & 0 deletions .buildkite/scripts/steps/build-agent-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ source .buildkite/scripts/common.sh

echo "+++ Build Agent artifacts"
SNAPSHOT=""
VERSION_QUALIFIER="${VERSION_QUALIFIER:=""}"
BEAT_VERSION_FULL=$BEAT_VERSION

if [ "$DRA_WORKFLOW" == "snapshot" ]; then
SNAPSHOT="true"
BEAT_VERSION_FULL="${BEAT_VERSION}-SNAPSHOT"
fi

if [[ "$DRA_WORKFLOW" == "staging" ]] && [[ -n "$VERSION_QUALIFIER" ]]; then
BEAT_VERSION_FULL="${BEAT_VERSION_FULL}-${VERSION_QUALIFIER}"
fi

SNAPSHOT=$SNAPSHOT mage packageAgentCore
chmod -R 777 build/distributions

Expand Down
7 changes: 5 additions & 2 deletions .buildkite/scripts/steps/dra-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ WORKFLOW="${DRA_WORKFLOW:=""}"
COMMIT="${DRA_COMMIT:="${BUILDKITE_COMMIT:=""}"}"
BRANCH="${DRA_BRANCH:="${BUILDKITE_BRANCH:=""}"}"
PACKAGE_VERSION="${DRA_VERSION:="${BEAT_VERSION:=""}"}"
VERSION_QUALIFIER="${VERSION_QUALIFIER:=""}"

# force main branch on PR's or it won't execute
# because the PR branch does not have a project folder in release-manager
Expand Down Expand Up @@ -50,7 +51,8 @@ function run_release_manager_list() {
--commit "${_commit}" \
--workflow "${_workflow}" \
--version "${_version}" \
--artifact-set "${_artifact_set}"
--artifact-set "${_artifact_set}" \
--qualifier "${VERSION_QUALIFIER}"
}

# Publish DRA artifacts
Expand All @@ -71,10 +73,11 @@ function run_release_manager_collect() {
--workflow "${_workflow}" \
--version "${_version}" \
--artifact-set "${_artifact_set}" \
--qualifier "${VERSION_QUALIFIER}"
${_dry_run}
}

echo "+++ Release Manager ${WORKFLOW} / ${BRANCH} / ${COMMIT}";
echo "+++ Release Manager Workflow: ${WORKFLOW} / Branch: ${BRANCH} / VERSION_QUALIFIER: ${VERSION_QUALIFIER} / Commit: ${COMMIT}"
run_release_manager_list "${DRA_PROJECT_ID}" "${DRA_PROJECT_ARTIFACT_ID}" "${WORKFLOW}" "${COMMIT}" "${BRANCH}" "${PACKAGE_VERSION}"
run_release_manager_collect "${DRA_PROJECT_ID}" "${DRA_PROJECT_ARTIFACT_ID}" "${WORKFLOW}" "${COMMIT}" "${BRANCH}" "${PACKAGE_VERSION}" "${DRY_RUN}"
RM_EXIT_CODE=$?
Expand Down
Loading