Skip to content

Commit 88c65c8

Browse files
authored
Merge pull request #794 from droot/running/use-vendor-gcs-bucket
🏃 use vendor tarball from GCS bucket
2 parents 2796e1a + ec4fa49 commit 88c65c8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test.sh

+14-1
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,27 @@ y
8585
EOF
8686
}
8787

88+
# download_vendor_archive downloads vendor tarball for v1 projects. It skips the
89+
# download if tarball exists.
90+
function download_vendor_archive {
91+
archive_name="vendor.v1.tgz"
92+
archive_download_url="https://storage.googleapis.com/kubebuilder-vendor/$archive_name"
93+
archive_path="$tmp_root/$archive_name"
94+
if [ ! -f $archive_path ]; then
95+
header_text "downloading vendor archive $archive_path"
96+
curl -sL ${archive_download_url} -o "$archive_path"
97+
fi
98+
}
99+
88100
function test_project {
89101
project_dir=$1
90102
version=$2
91103
header_text "performing tests in dir $project_dir for project version v$version"
92-
vendor_tarball=$(pwd)/testdata/vendor.v$version.tgz
104+
vendor_tarball=$tmp_root/vendor.v$version.tgz
93105
old_gopath=$GOPATH
94106
if [[ $version == "1" ]]; then
95107
export GOPATH=$(pwd)/testdata/gopath
108+
download_vendor_archive
96109
fi
97110
cd testdata/$project_dir
98111
# v2 uses modules, and thus doesn't have a vendor directory

0 commit comments

Comments
 (0)