From bcc4367f864f74fec7b3f2cea92bab356e98dbee Mon Sep 17 00:00:00 2001 From: James Cotter <35706755+jac@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:43:02 +0100 Subject: [PATCH] msp/deploy: add 'author' and 'commit_message' annotations (#63108) Add 'author' and 'commit_message' annotations on release ## Test plan CI --- dev/ci/msp_deploy.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dev/ci/msp_deploy.sh b/dev/ci/msp_deploy.sh index 36d4e86b72674..22b7784cd56df 100755 --- a/dev/ci/msp_deploy.sh +++ b/dev/ci/msp_deploy.sh @@ -11,18 +11,14 @@ set -eux -o pipefail # CI Variables : "${BUILDKITE_BUILD_NUMBER:?"BUILDKITE_BUILD_NUMBER is required"}" : "${BUILDKITE_COMMIT:?"BUILDKITE_COMMIT is required"}" - -# TODO: figure out a good way to capture author details -# can contain only lowercase letters, numeric characters, underscores, and dashes. -# All characters must use UTF-8 encoding, and international characters are allowed. -# Keys must start with a lowercase letter or international character -# : ${BUILDKITE_BUILD_AUTHOR_EMAIL:?"BUILDKITE_BUILD_AUTHOR_EMAIL is required"} +: "${BUILDKITE_BUILD_AUTHOR:?"BUILDKITE_BUILD_AUTHOR is required"}" # Computed Variables GCP_CLOUDRUN_SKAFFOLD_SOURCE="gs://${GCP_PROJECT}-cloudrun-skaffold/source.tar.gz" GCP_DELIVERY_PIPELINE="${MSP_SERVICE_ID}-${GCP_REGION}-rollout" SHORT_SHA="${BUILDKITE_COMMIT:0:12}" TAG="${SHORT_SHA}_${BUILDKITE_BUILD_NUMBER}" +COMMIT_MESSAGE="$(git log -n 1 --pretty=format:'%s')" # resource ids must be lower-case letters, numbers, and hyphens, # with the first character a letter, the last a letter or a number, # and a 63 character maximum @@ -43,4 +39,4 @@ gcloud=$2 --source="${GCP_CLOUDRUN_SKAFFOLD_SOURCE}" \ --labels="commit=${BUILDKITE_COMMIT}" \ --deploy-parameters="customTarget/tag=${TAG}" \ - --annotations="commit=${BUILDKITE_COMMIT}" + --annotations="commit=${BUILDKITE_COMMIT},author=${BUILDKITE_BUILD_AUTHOR},commit_message=${COMMIT_MESSAGE}"