Skip to content

Commit

Permalink
fix: only strip the github/repo-name prefix if the file doesn't exist (
Browse files Browse the repository at this point in the history
…#61)

Supports multi_scm Kokoro environments
  • Loading branch information
chingor13 authored Nov 6, 2024
1 parent e6d88de commit 5696833
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions trampoline_v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,12 @@ do
fi
done

# We want to support legacy style TRAMPOLINE_BUILD_FILE used with V1
# script: e.g. "github/repo-name/.kokoro/run_tests.sh"
TRAMPOLINE_BUILD_FILE="${TRAMPOLINE_BUILD_FILE#github/*/}"
if [[ ! -f "${TRAMPOLINE_BUILD_FILE}" ]]; then
# We want to support legacy style TRAMPOLINE_BUILD_FILE used with V1
# script: e.g. "github/repo-name/.kokoro/run_tests.sh"
log_yellow "TRAMPOLINE_BUILD_FILE is not found at provided path, stripping github and repo name."
TRAMPOLINE_BUILD_FILE="${TRAMPOLINE_BUILD_FILE#github/*/}"
fi
log_yellow "Using TRAMPOLINE_BUILD_FILE: ${TRAMPOLINE_BUILD_FILE}"

# ignore error on docker operations and test execution
Expand Down Expand Up @@ -505,4 +508,4 @@ if [[ "${update_cache}" == "true" ]] && \
fi
fi

exit "${test_retval}"
exit "${test_retval}"

0 comments on commit 5696833

Please sign in to comment.