mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 18:12:55 +01:00
Add gcloud installation script
This commit is contained in:
parent
be7af7d540
commit
a0317aa98d
1 changed files with 27 additions and 0 deletions
27
scripts/install-gcloud
Executable file
27
scripts/install-gcloud
Executable file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -xeuo pipefail
|
||||||
|
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
GCLOUD_VERSION=${1}
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
apt-get -y install \
|
||||||
|
apt-transport-https \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
python3 \
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
|
||||||
|
echo "deb https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
PACKAGE_VERSION=$(apt-cache policy google-cloud-cli | awk -v dv=${GCLOUD_VERSION} '$1 ~ dv {print $1}')
|
||||||
|
|
||||||
|
apt-get install -y google-cloud-cli=${PACKAGE_VERSION}
|
||||||
|
apt-get -yq autoremove
|
||||||
|
apt-get clean -yqq
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
Loading…
Add table
Add a link
Reference in a new issue