#!/bin/bash

set -e

curl -o /usr/share/keyrings/gcp.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

cat <<EOF >/etc/apt/sources.list.d/gcp.list
# https://cloud.google.com/compute/docs/troubleshooting/known-issues#keyexpired-2
# To update GCP GPG key use:
#   curl -o /usr/share/keyrings/gcp.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg

deb [signed-by=/usr/share/keyrings/gcp.gpg] http://packages.cloud.google.com/apt cloud-sdk main
EOF
