Skip to content

Commit

Permalink
chore: migrate 3.x release kokoro builds to use new release process (#…
Browse files Browse the repository at this point in the history
…3357)

* chore: migrate kokoro builds to use new release image

* add better comment for docker auth logic
  • Loading branch information
ldetmer authored Nov 1, 2024
1 parent d9d5daa commit cc044f3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .kokoro/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build_file: "spring-cloud-gcp/.kokoro/trampoline.sh"
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
value: "us-central1-docker.pkg.dev/cloud-sdk-release-custom-pool/release-images/java8"
}

before_action {
Expand Down
5 changes: 2 additions & 3 deletions .kokoro/populate-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ function msg { println "$*" >&2 ;}
function println { printf '%s\n' "$(now) $*" ;}


# Populates requested secrets set in SECRET_MANAGER_KEYS from service account:
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com
# Populates requested secrets set in SECRET_MANAGER_KEYS:
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
mkdir -p ${SECRET_LOCATION}
Expand All @@ -32,7 +31,7 @@ do
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
gcr.io/google.com/cloudsdktool/cloud-sdk \
secrets versions access latest \
--project cloud-devrel-kokoro-resources \
--project cloud-sdk-release-custom-pool \
--secret ${key} > \
"${SECRET_LOCATION}/${key}"
if [[ $? == 0 ]]; then
Expand Down
11 changes: 10 additions & 1 deletion .kokoro/trampoline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,13 @@ function cleanup() {
trap cleanup EXIT

$(dirname $0)/populate-secrets.sh # Secret Manager secrets.
python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py"
TRAMPOLINE_HOST=$(echo "${TRAMPOLINE_IMAGE}" | cut -d/ -f1)
if [[ ! "${TRAMPOLINE_HOST}" =~ "gcr.io" ]]; then
# You have to run on an update version of gcloud, in order to pass in the host name
# in configure-docker command. This is not necessary for gcr.io because that is a default
# repository name and is not required to specify the repo when running configure-docker.
echo "TRAMPOLINE_HOST: ${TRAMPOLINE_HOST}"
gcloud components update
gcloud auth configure-docker "${TRAMPOLINE_HOST}"
fi
python3 "${KOKORO_GFILE_DIR}/trampoline_release.py"

0 comments on commit cc044f3

Please sign in to comment.