diff --git a/.circleci/config.yml b/.circleci/config.yml index ded07244c..91a62d55f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -241,11 +241,20 @@ jobs: - run: name: Install gcloud command: | - # Add the Cloud SDK distribution URI as a package source - echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list - # Import the Google Cloud Platform public key curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - + + # Use keyring to store gpg key + sudo mkdir -m 0755 -p /etc/apt/keyrings/ + wget -O- https://packages.cloud.google.com/apt/doc/apt-key.gpg | + gpg --dearmor | + sudo tee /etc/apt/keyrings/google-cloud.gpg > /dev/null + sudo chmod 644 /etc/apt/keyrings/google-cloud.gpg + + # Add the Cloud SDK distribution URI as a package source + echo "deb [signed-by=/etc/apt/keyrings/google-cloud.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | + sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list + sudo chmod 644 /etc/apt/sources.list.d/google-cloud-sdk.list # Update the package list and install the Cloud SDK sudo apt-get update -y && sudo apt-get install -y google-cloud-sdk