From d032d9d773aedaa1e448116425d21c7cf83bb0f4 Mon Sep 17 00:00:00 2001 From: Marc Guasch Date: Fri, 14 Jul 2023 13:02:41 +0200 Subject: [PATCH] Fix version --- .buildkite/pipeline.elastic-agent-binary-dra.yml | 7 +++---- .buildkite/scripts/bootstrap.sh | 8 +++++++- .buildkite/scripts/steps/build-agent-core.sh | 4 ---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.buildkite/pipeline.elastic-agent-binary-dra.yml b/.buildkite/pipeline.elastic-agent-binary-dra.yml index e4b8d151e96..ec47200daa3 100644 --- a/.buildkite/pipeline.elastic-agent-binary-dra.yml +++ b/.buildkite/pipeline.elastic-agent-binary-dra.yml @@ -1,4 +1,6 @@ env: + DRA_PROJECT: "elastic-agent-core" + DRA_ARTIFACT_SET: "agent-core" RUN_SNAPSHOT: "true" RUN_STAGING: "true" FORCE_NO_DRA_DRY_RUN: "true" @@ -27,8 +29,7 @@ steps: provider: "gcp" machineType: "c2-standard-16" env: - DRA_PROJECT: "elastic-agent-core" - DRA_ARTIFACT_SET: "agent-core" + WORKFLOW: "snapshot" - group: ":beats: DRA Elastic-Agent Core Staging :beats:" @@ -55,8 +56,6 @@ steps: provider: "gcp" machineType: "c2-standard-16" env: - DRA_PROJECT: "elastic-agent-core" - DRA_ARTIFACT_SET: "agent-core" WORKFLOW: "staging" notify: diff --git a/.buildkite/scripts/bootstrap.sh b/.buildkite/scripts/bootstrap.sh index 9b9519feae6..f3a19f28682 100755 --- a/.buildkite/scripts/bootstrap.sh +++ b/.buildkite/scripts/bootstrap.sh @@ -10,7 +10,13 @@ if [[ -z "${WORKSPACE-""}" ]]; then fi # Retrieve version value - will match versions like 8.8.0 and also 8.8.0-er1 -export BEAT_VERSION=`grep -oE '[0-9]+\.[0-9]+\.[0-9]+(\-[a-zA-Z]+[0-9]+)?' ${WORKSPACE}/version/version.go` +BEAT_VERSION=`grep -oE '[0-9]+\.[0-9]+\.[0-9]+(\-[a-zA-Z]+[0-9]+)?' ${WORKSPACE}/version/version.go` +SNAPSHOT="" +if [ "$WORKFLOW" == "snapshot" ]; then + SNAPSHOT="true" + BEAT_VERSION="${BEAT_VERSION}-SNAPSHOT" +fi +export SNAPSHOT BEAT_VERSION export BRANCH="${BUILDKITE_BRANCH}" # Install Go TODO: move to makefile diff --git a/.buildkite/scripts/steps/build-agent-core.sh b/.buildkite/scripts/steps/build-agent-core.sh index 3bc8d9576fe..687b5a33946 100755 --- a/.buildkite/scripts/steps/build-agent-core.sh +++ b/.buildkite/scripts/steps/build-agent-core.sh @@ -5,10 +5,6 @@ set -euo pipefail source .buildkite/scripts/bootstrap.sh echo "+++ Build Agent artifacts" -SNAPSHOT="" -if [ "$WORKFLOW" == "snapshot" ]; then - SNAPSHOT="true" -fi SNAPSHOT=$SNAPSHOT mage packageAgentCore chmod -R 777 build/distributions