mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-11 02:52:56 +01:00
Support building gcloud in UBI
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
This commit is contained in:
parent
0f5bc500c3
commit
523e57a7a5
1 changed files with 25 additions and 0 deletions
|
|
@ -25,6 +25,31 @@ function build_debian() {
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function build_ubi() {
|
||||||
|
BUILD_ARCH=$(arch)
|
||||||
|
UBI_VERSION=$(lsb_release -a | awk '/Release/ { print $2 }')
|
||||||
|
UBI_MAJOR_VERSION=${UBI_VERSION%.*} # strip last component
|
||||||
|
|
||||||
|
{ awk '{$1=$1};1' | tee -a /etc/yum.repos.d/google-cloud-sdk.repo; } <<- EOM
|
||||||
|
[google-cloud-cli]
|
||||||
|
name=Google Cloud CLI
|
||||||
|
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el${UBI_MAJOR_VERSION}-${BUILD_ARCH}
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=1
|
||||||
|
repo_gpgcheck=0
|
||||||
|
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
|
||||||
|
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
|
||||||
|
EOM
|
||||||
|
|
||||||
|
yum update -y
|
||||||
|
|
||||||
|
PACKAGE_VERSION=$(yum --showduplicates list google-cloud-cli | awk -v dv=${GCLOUD_VERSION} '$2 ~ dv {print $2}')
|
||||||
|
yum install -y google-cloud-cli-${PACKAGE_VERSION}
|
||||||
|
|
||||||
|
yum autoremove -y
|
||||||
|
yum clean -y all
|
||||||
|
}
|
||||||
|
|
||||||
BUILD_OS=${BUILD_OS:-debian}
|
BUILD_OS=${BUILD_OS:-debian}
|
||||||
|
|
||||||
if [[ $BUILD_OS =~ debian ]]; then
|
if [[ $BUILD_OS =~ debian ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue