From dac34a21d46b1ae7245085cd5ae96883af48ff1a Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Thu, 18 Jul 2024 10:37:41 +1000 Subject: [PATCH 1/2] Shell cleanup --- .buildkite/steps/build-github-release.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.buildkite/steps/build-github-release.sh b/.buildkite/steps/build-github-release.sh index e876ce50e4..d091fb718b 100755 --- a/.buildkite/steps/build-github-release.sh +++ b/.buildkite/steps/build-github-release.sh @@ -1,15 +1,18 @@ -#!/bin/bash -set -e +#!/usr/bin/env bash +set -euo pipefail echo '--- Getting agent version from build meta data' -export FULL_AGENT_VERSION=$(buildkite-agent meta-data get "agent-version-full") -export AGENT_VERSION=$(buildkite-agent meta-data get "agent-version") -export BUILD_VERSION=$(buildkite-agent meta-data get "agent-version-build") +FULL_AGENT_VERSION="$(buildkite-agent meta-data get "agent-version-full")" +AGENT_VERSION="$(buildkite-agent meta-data get "agent-version")" +BUILD_VERSION="$(buildkite-agent meta-data get "agent-version-build")" +export FULL_AGENT_VERSION +export AGENT_VERSION +export BUILD_VERSION -echo "Full agent version: $FULL_AGENT_VERSION" -echo "Agent version: $AGENT_VERSION" -echo "Build version: $BUILD_VERSION" +echo "Full agent version: ${FULL_AGENT_VERSION}" +echo "Agent version: ${AGENT_VERSION}" +echo "Build version: ${BUILD_VERSION}" echo '--- Downloading binaries' @@ -20,7 +23,7 @@ buildkite-agent artifact download "pkg/*" . function build() { echo "--- Building release for: $1" - ./scripts/build-github-release.sh $1 $AGENT_VERSION + ./scripts/build-github-release.sh $1 "${AGENT_VERSION}" } # Export the function so we can use it in xargs From eaf2d304d5bf78518eac1971ce52d39f18fea0c6 Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Thu, 18 Jul 2024 10:39:31 +1000 Subject: [PATCH 2/2] Write a SHA256SUMS file --- .buildkite/steps/build-github-release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.buildkite/steps/build-github-release.sh b/.buildkite/steps/build-github-release.sh index d091fb718b..7aa14939a1 100755 --- a/.buildkite/steps/build-github-release.sh +++ b/.buildkite/steps/build-github-release.sh @@ -34,3 +34,6 @@ rm -rf releases # Loop over all the binaries and build them ls pkg/* | xargs -I {} bash -c "build {}" + +# Add a SHA256SUMS file +(cd releases ; sha256sum * > "buildkite-agent-${AGENT_VERSION}.SHA256SUMS")