Skip to content

Commit

Permalink
msp/deploy: add 'author' and 'commit_message' annotations (#63108)
Browse files Browse the repository at this point in the history
Add 'author' and 'commit_message' annotations on release

## Test plan
CI
  • Loading branch information
jac committed Jun 5, 2024
1 parent cff84a0 commit bcc4367
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions dev/ci/msp_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"

0 comments on commit bcc4367

Please sign in to comment.