From 24707a997728a21c41bf5f18891b05d8658bbee3 Mon Sep 17 00:00:00 2001 From: Corey Sarsfield Date: Wed, 5 Jun 2024 12:22:58 -0400 Subject: [PATCH 1/3] Internal: move louhi-specific codename logic --- kokoro/scripts/test/go_test.sh | 4 ---- kokoro/scripts/utils/louhi.sh | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kokoro/scripts/test/go_test.sh b/kokoro/scripts/test/go_test.sh index 24014ad55b..b2f2ba4929 100755 --- a/kokoro/scripts/test/go_test.sh +++ b/kokoro/scripts/test/go_test.sh @@ -77,10 +77,6 @@ function set_image_specs() { # 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 # 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/utils/louhi.sh b/kokoro/scripts/utils/louhi.sh index 5e40a24cad..5041bb9f03 100644 --- a/kokoro/scripts/utils/louhi.sh +++ b/kokoro/scripts/utils/louhi.sh @@ -33,4 +33,9 @@ function parse_louhi_tag() { ARCH="${_LOUHI_TAG_COMPONENTS[4]}" export ARTIFACT_REGISTRY_PROJECT="${_STAGING_ARTIFACTS_PROJECT_ID}" # Louhi is responsible for passing this. fi + + EXT=$(yaml project.yaml "['targets']['${TARGET}']['package_extension']") + if [[ "${EXT}" == "deb" ]]; then + export REPO_CODENAME="${TARGET}-${ARCH}" + fi } \ No newline at end of file From e2bd3d87d179412d05996c51b0a25a932385e38c Mon Sep 17 00:00:00 2001 From: Corey Sarsfield Date: Wed, 5 Jun 2024 13:09:27 -0400 Subject: [PATCH 2/3] move logic iwithin tag check --- kokoro/scripts/utils/louhi.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kokoro/scripts/utils/louhi.sh b/kokoro/scripts/utils/louhi.sh index 5041bb9f03..b254dffdbb 100644 --- a/kokoro/scripts/utils/louhi.sh +++ b/kokoro/scripts/utils/louhi.sh @@ -32,10 +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. - fi - EXT=$(yaml project.yaml "['targets']['${TARGET}']['package_extension']") - if [[ "${EXT}" == "deb" ]]; then - export REPO_CODENAME="${TARGET}-${ARCH}" + 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 From 155917c539ce7553756810fdf9a2efc225858f51 Mon Sep 17 00:00:00 2001 From: Corey Sarsfield Date: Wed, 5 Jun 2024 15:00:39 -0400 Subject: [PATCH 3/3] updated function name --- kokoro/scripts/test/go_test.sh | 4 +--- kokoro/scripts/test/start_soak_test.sh | 2 +- kokoro/scripts/utils/louhi.sh | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/kokoro/scripts/test/go_test.sh b/kokoro/scripts/test/go_test.sh index b2f2ba4929..ef64bbcd44 100755 --- a/kokoro/scripts/test/go_test.sh +++ b/kokoro/scripts/test/go_test.sh @@ -74,9 +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 + 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 b254dffdbb..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