Add Google Cloud SDK for Windows (#1102)

* Add Google Cloud SDK

* Add Validate-GoogleCloudSDK.ps1 script
This commit is contained in:
Aleksandr Chebotov
2020-06-24 11:37:36 +03:00
committed by GitHub
parent f342a7de2d
commit 4c34ad64df
6 changed files with 58 additions and 1 deletions

View File

@@ -682,6 +682,12 @@
"{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1"
]
},
{
"type": "windows-restart",
"restart_timeout": "30m"
@@ -998,6 +1004,12 @@
"{{ template_dir }}/scripts/Installers/Validate-MongoDB.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-GoogleCloudSDK.ps1"
]
},
{
"type": "powershell",
"scripts":[

View File

@@ -667,6 +667,12 @@
"{{ template_dir }}/scripts/Installers/Install-MongoDB.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Install-GoogleCloudSDK.ps1"
]
},
{
"type": "windows-restart",
"restart_timeout": "10m"
@@ -989,6 +995,12 @@
"{{ template_dir }}/scripts/Installers/Validate-AliyunCli.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-GoogleCloudSDK.ps1"
]
},
{
"type": "powershell",
"scripts":[

View File

@@ -0,0 +1,9 @@
################################################################################
## File: Install-GoogleCloudSDK.ps1
## Desc: Install Google Cloud SDK
################################################################################
# https://cloud.google.com/sdk/docs/downloads-interactive
$googleCloudSDKInstaller = "https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe"
$argumentList = @("/S", "/allusers", "/noreporting")
Install-Binary -Url $googleCloudSDKInstaller -Name "GoogleCloudSDKInstaller.exe" -ArgumentList $argumentList

View File

@@ -0,0 +1,19 @@
################################################################################
## File: Validate-GoogleCloudSDK.ps1
## Desc: Validate Install Google Cloud SDK for Windows
################################################################################
# Simple validation gcloud, gsutil, and bq command line tools
$validateTools = @("bq", "gcloud", "gsutil")
foreach($tool in $validateTools)
{
if (Get-Command -Name $tool)
{
Write-Host "$tool on path"
}
else
{
Write-Host "$tool is not on path"
exit 1
}
}

View File

@@ -101,7 +101,8 @@ $markdown += New-MDList -Style Unordered -Lines @(
(Get-AWSSAMVersion),
(Get-AlibabaCLIVersion),
(Get-CloudFoundryVersion),
(Get-HubVersion)
(Get-HubVersion),
(Get-GoogleCloudSDKVersion)
)
$markdown += New-MDHeader "Browsers and webdrivers" -Level 3

View File

@@ -202,4 +202,8 @@ function Get-StackVersion {
((stack --version --quiet) | Out-String) -match "Version (?<version>\d+\.\d+\.\d+)," | Out-Null
$stackVersion = $Matches.Version
return "Stack $stackVersion"
}
function Get-GoogleCloudSDKVersion {
(gcloud --version) -match "Google Cloud SDK"
}