Skip to content

Commit 84a537e

Browse files
committed
buildscripts: xds-k8s use shared driver install library
1 parent ac8ac8b commit 84a537e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

buildscripts/kokoro/xds-k8s.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set -eo pipefail
33

44
# Constants
55
readonly GITHUB_REPOSITORY_NAME="grpc-java"
6+
readonly INSTALL_DRIVER_LIB_DOWNLOAD="${INSTALL_DRIVER_LIB_DOWNLOAD:-1}"
7+
readonly INSTALL_DRIVER_LIB_DOWNLOAD_URL="https://raw.githubusercontent.com/grpc/grpc/master/tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh"
68
# GKE Cluster
79
readonly GKE_CLUSTER_NAME="interop-test-psm-sec-testing-api"
810
readonly GKE_CLUSTER_ZONE="us-west1-b"
@@ -147,8 +149,20 @@ run_test() {
147149
main() {
148150
local script_dir
149151
script_dir="$(dirname "$0")"
150-
# shellcheck source=buildscripts/kokoro/xds-k8s-install-test-driver.sh
151-
source "${script_dir}/xds-k8s-install-test-driver.sh"
152+
153+
local install_driver_lib_path
154+
if [[ -n "${INSTALL_DRIVER_LIB_DOWNLOAD}" && -n "${INSTALL_DRIVER_LIB_DOWNLOAD_URL}" ]]; then
155+
# Download shared install driver library.
156+
echo "Downloading shared install driver common library: ${INSTALL_DRIVER_LIB_DOWNLOAD_URL}."
157+
install_driver_lib_path="$(mktemp -d)/grpc_xds_k8s_install_test_driver.sh"
158+
wget --https-only "${INSTALL_DRIVER_LIB_DOWNLOAD_URL}" -O "$(mktemp -d)/grpc_xds_k8s_install_test_driver.sh"
159+
else
160+
# Use local driver library (use for development).
161+
install_driver_lib_path="${script_dir}/grpc_xds_k8s_install_test_driver.sh"
162+
echo "Using local shared install driver common library: ${install_driver_lib_path}"
163+
fi
164+
165+
source "${install_driver_lib_path}"
152166
set -x
153167
if [[ -n "${KOKORO_ARTIFACTS_DIR}" ]]; then
154168
kokoro_setup_test_driver "${GITHUB_REPOSITORY_NAME}"

0 commit comments

Comments
 (0)