diff --git a/.trampolinerc b/.trampolinerc index 5fc22531..18e2baee 100644 --- a/.trampolinerc +++ b/.trampolinerc @@ -49,4 +49,19 @@ if [[ -z "${TRAMPOLINE_BUILD_FILE:-}" ]]; then fi # Secret Manager secrets. +TRAMPOLINE_HOST=$(echo "${TRAMPOLINE_IMAGE}" | cut -d/ -f1) +if [[ ! "${TRAMPOLINE_HOST}" =~ "gcr.io" ]] +then + echo "TRAMPOLINE_HOST: ${TRAMPOLINE_HOST}" + echo "HOME: ${HOME}" + echo "${HOME}":/home + docker run \ + --entrypoint=gcloud \ + --env HOME=:/home \ + --volume="${HOME}":/home \ + "gcr.io/google.com/cloudsdktool/cloud-sdk" \ + auth configure-docker "${TRAMPOLINE_HOST}" + echo "docker config:" + cat "${HOME}/.docker/config.json" +fi source ${PROJECT_ROOT}/.kokoro/populate-secrets.sh