Skip to content
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
14 changes: 14 additions & 0 deletions .buildkite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Overriding DRA version for ITs

There are instances when the DRA does not generate the latest versions, which can occur during the Feature Freeze. However, the ITs need these latest versions for testing.

To address this issue, you can force the DRA version by creating the following two files:

* `.agent-version`
* `.beat-version`

The content, should be the version to be used, normally, `major.minor.patch`.

These files will be read by the `pre-command` hook, which will then create the environment variables `AGENT_VERSION`, `BEAT_VERSION`, and `AGENT_PACKAGE_VERSION`.

Those environment variables are consumed by the Mage files.
13 changes: 13 additions & 0 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ if [[ -z "${GO_VERSION-""}" ]]; then
export GO_VERSION=$(cat "${WORKSPACE}/.go-version")
fi

# Begin DRA override
# When DRA is not creating the binaries, we can use the files
# to override
if [[ -f "${WORKSPACE}/.beat-version" ]]; then
export BEAT_VERSION=$(cat "${WORKSPACE}/.beat-version")
fi

if [[ -f "${WORKSPACE}/.agent-version" ]]; then
export AGENT_PACKAGE_VERSION=$(cat "${WORKSPACE}/.agent-version")
export AGENT_VERSION="$(cat "${WORKSPACE}/.agent-version")-SNAPSHOT"
fi
# End DRA override

CI_DRA_ROLE_PATH="kv/ci-shared/release/dra-role"
CI_GCP_OBS_PATH="kv/ci-shared/observability-ingest/cloud/gcp"
# This key exists for backward compatibility with OGC framework
Expand Down
16 changes: 16 additions & 0 deletions .buildkite/hooks/pre-command.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# Shorten BUILDKITE_MESSAGE if needed to avoid filling the Windows env var buffer
$env:BUILDKITE_MESSAGE = $env:BUILDKITE_MESSAGE.Substring(0, [System.Math]::Min(2048, $env:BUILDKITE_MESSAGE.Length))

# Begin DRA override
# When DRA is not creating the binaries, we can use the files
# to override
if (Test-Path -Path .beat-version) {
$beat_version = Get-Content -Path .beat-version -Raw
$env:BEAT_VERSION = $beat_version.Trim()
}

if (Test-Path -Path .agent-version) {
$agent_version = Get-Content -Path .agent-version -Raw
$agent_version = $agent_version.Trim()
$env:AGENT_PACKAGE_VERSION = $agent_version
$env:AGENT_VERSION = "$agent_version-SNAPSHOT"
}
# End DRA override
Loading