diff --git a/kokoro/scripts/test/go_test.sh b/kokoro/scripts/test/go_test.sh index 24014ad55b..ef64bbcd44 100755 --- a/kokoro/scripts/test/go_test.sh +++ b/kokoro/scripts/test/go_test.sh @@ -74,13 +74,7 @@ function set_image_specs() { if [[ -n "${IMAGE_SPECS:-}" ]]; then return 0 fi - # if _LOUHI_TAG_NAME is defined, set TARGET and ARCH env vars by parsing it. - # Example value: louhi/2.46.0/shortref/windows/x86_64/start - parse_louhi_tag - EXT=$(yaml project.yaml "['targets']['${TARGET}']['package_extension']") - if [[ "${EXT}" == "deb" ]]; then - export REPO_CODENAME="${TARGET}-${ARCH}" - fi + populate_env_vars_from_louhi_tag_if_present # if TARGET is not set, return an error if [[ -z "${TARGET:-}" ]]; then echo "At least one of TARGET/IMAGE_SPECS must be set." 1>&2 diff --git a/kokoro/scripts/test/start_soak_test.sh b/kokoro/scripts/test/start_soak_test.sh index 7bb6c31263..f3cd45f3cd 100644 --- a/kokoro/scripts/test/start_soak_test.sh +++ b/kokoro/scripts/test/start_soak_test.sh @@ -13,7 +13,7 @@ cd ../../../ source kokoro/scripts/utils/louhi.sh # For soak tests run by Louhi -parse_louhi_tag +populate_env_vars_from_louhi_tag_if_present # if TARGET & ARCH are set, retrieve the soak distro from project.yaml if [[ -n "${TARGET:-}" && -n "${ARCH:-}" ]]; then DISTRO=$(yaml project.yaml "['targets']['${TARGET}']['architectures']['${ARCH}']['soak_distro']") diff --git a/kokoro/scripts/utils/louhi.sh b/kokoro/scripts/utils/louhi.sh index 5e40a24cad..93c178ca67 100644 --- a/kokoro/scripts/utils/louhi.sh +++ b/kokoro/scripts/utils/louhi.sh @@ -23,7 +23,7 @@ else: print(data)" } -function parse_louhi_tag() { +function populate_env_vars_from_louhi_tag_if_present() { # if _LOUHI_TAG_NAME is defined, set TARGET and ARCH env vars by parsing it. # Example value: louhi/2.46.0/shortref/windows/x86_64/start if [[ -n "${_LOUHI_TAG_NAME:-}" ]]; then @@ -32,5 +32,10 @@ function parse_louhi_tag() { TARGET="${_LOUHI_TAG_COMPONENTS[3]}" ARCH="${_LOUHI_TAG_COMPONENTS[4]}" export ARTIFACT_REGISTRY_PROJECT="${_STAGING_ARTIFACTS_PROJECT_ID}" # Louhi is responsible for passing this. + + EXT=$(yaml project.yaml "['targets']['${TARGET}']['package_extension']") + if [[ "${EXT}" == "deb" ]]; then + export REPO_CODENAME="${TARGET}-${ARCH}" + fi fi } \ No newline at end of file