diff --git a/src/test/groovy/GsutilStepTests.groovy b/src/test/groovy/GsutilStepTests.groovy index 96c9a565b..baeabfc2d 100644 --- a/src/test/groovy/GsutilStepTests.groovy +++ b/src/test/groovy/GsutilStepTests.groovy @@ -134,7 +134,7 @@ class GsutilStepTests extends ApmBasePipelineTest { script.call(command: 'cp', credentialsId: 'foo') printCallStack() assertTrue(assertMethodCallContainsPattern('withEnv', 'PATH+GSUTIL')) - assertTrue(assertMethodCallContainsPattern('bat', 'wget -q -O gsutil.zip https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-319.0.0-windows-x86_64.zip')) + assertTrue(assertMethodCallContainsPattern('bat', 'wget -q -O gsutil.zip https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-319.0.0-windows-x86_64-bundled-python.zip')) assertJobStatusSuccess() } } diff --git a/vars/gsutil.groovy b/vars/gsutil.groovy index f7467507d..9d48b4ef9 100644 --- a/vars/gsutil.groovy +++ b/vars/gsutil.groovy @@ -67,9 +67,13 @@ def downloadWithCurl(tarball, url) { def googleCloudSdkURL() { def url = 'https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-319.0.0' - def os = isUnix() ? 'linux' : 'windows' - def ext = isUnix() ? 'tar.gz' : 'zip' - return "${url}-${os}-${is64() ? 'x86_64' : 'x86'}.${ext}" + def arch = is64() ? 'x86_64' : 'x86' + if (isUnix()) { + return "${url}-linux-${arch}.tar.gz" + } else { + // use the bundled python artifact to avoid issues with the existing python2 installation when running gsutil in some Windows versions + return "${url}-windows-${arch}-bundled-python.zip" + } } def uncompress(tarball) {