Cache chrome for correct debian version

This commit is contained in:
Andrejs Cunskis 2022-11-08 12:49:31 +00:00 committed by Balasankar 'Balu' C
parent 03d90d36f2
commit 7d00e776ae
7 changed files with 40 additions and 13 deletions

View file

@ -48,18 +48,26 @@ function build_debian() {
rm -rf /etc/apt/sources.list.d/google*.list
}
function build_ubi() {
echo "This OS is not supported for chrome install!"
exit 1
}
BUILD_OS=${BUILD_OS:-debian}
OS_VERSION=${OS_VERSION:-bullseye}
CHROME_VERSION=${1:-107.0.5304.87-1}
ARCH=${TARGETARCH:-amd64}
if [ "${ARCH}" == "amd64" ]; then
PKG=google-chrome-stable
else
PKG=chromium
fi
DOWNLOAD_URL_BASE="https://gitlab.com/api/v4/projects/1075790/packages/generic/${PKG}"
PKG=$([ "${ARCH}" == "amd64" ] && echo "google-chrome-stable" || echo "chromium")
DOWNLOAD_URL_BASE="https://gitlab.com/api/v4/projects/1075790/packages/generic/${BUILD_OS}-${OS_VERSION}-${PKG}"
if [[ $BUILD_OS =~ debian ]]; then
build_debian "$@"
elif [[ $BUILD_OS =~ ubi ]]; then
build_ubi "$@"
fi
if [ "${ARCH}" == "amd64" ]; then
google-chrome --version
else
chromium --version
fi