[ubuntu] Remove google-cloud-sdk repo (#3199)

This commit is contained in:
Aleksandr Chebotov
2021-04-16 19:24:24 +03:00
committed by GitHub
parent 0c6c332678
commit 4a2e5bca16
2 changed files with 12 additions and 2 deletions

View File

@@ -95,7 +95,8 @@ function Get-GitFTPVersion {
} }
function Get-GoogleCloudSDKVersion { function Get-GoogleCloudSDKVersion {
return "$(gcloud --version | Select-Object -First 1)" $aptSourceRepo = Get-AptSourceRepository -PackageName "google-cloud-sdk"
return "$(gcloud --version | Select-Object -First 1) (apt source repository: $aptSourceRepo)"
} }
function Get-HavegedVersion { function Get-HavegedVersion {

View File

@@ -4,10 +4,19 @@
## Desc: Installs the Google Cloud SDK ## Desc: Installs the Google Cloud SDK
################################################################################ ################################################################################
REPO_URL="https://packages.cloud.google.com/apt"
# Install the Google Cloud SDK # Install the Google Cloud SDK
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] $REPO_URL cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y google-cloud-sdk sudo apt-get install -y google-cloud-sdk
# remove apt
rm /etc/apt/sources.list.d/google-cloud-sdk.list
rm /usr/share/keyrings/cloud.google.gpg /usr/share/keyrings/cloud.google.gpg~
# add repo to the apt-sources.txt
echo "google-cloud-sdk $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
invoke_tests "CLI.Tools" "Google Cloud SDK" invoke_tests "CLI.Tools" "Google Cloud SDK"