From 308afad365b75cb5ac80a9740c43187e43e3565e Mon Sep 17 00:00:00 2001 From: Fatih USTA Date: Fri, 10 Feb 2023 17:50:33 +0300 Subject: [PATCH] Fixed Non docker image repository problem Issue: Docker has daily limitation for image pull request. We are using aws image repository. Example: IMAGE_BASE=public.ecr.aws/lts/ubuntu echo ${IMAGE_BASE/*\/} OUTPUT: ubuntu Signed-off-by: Fatih USTA --- utils/build-common.sh | 4 ++-- utils/determine-dist.sh | 6 +++--- utils/install-common.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/build-common.sh b/utils/build-common.sh index b6147b9fc..48afc8221 100755 --- a/utils/build-common.sh +++ b/utils/build-common.sh @@ -40,11 +40,11 @@ build_apisix_base_deb() { DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends wget gnupg ca-certificates wget -O - https://openresty.org/package/pubkey.gpg | apt-key add - - if [[ $IMAGE_BASE == "ubuntu" ]]; then + if [[ "${IMAGE_BASE/*\/}" == "ubuntu" ]]; then echo "deb http://openresty.org/package/${arch_path}ubuntu $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/openresty.list fi - if [[ $IMAGE_BASE == "debian" ]]; then + if [[ "${IMAGE_BASE/*\/}" == "debian" ]]; then echo "deb http://openresty.org/package/${arch_path}debian $(lsb_release -sc) openresty" | tee /etc/apt/sources.list.d/openresty.list fi diff --git a/utils/determine-dist.sh b/utils/determine-dist.sh index 0e67564c4..7ce902b10 100755 --- a/utils/determine-dist.sh +++ b/utils/determine-dist.sh @@ -3,13 +3,13 @@ set -euo pipefail set -x dist="el7" -if [ "${IMAGE_BASE}" == "centos" ] +if [ "${IMAGE_BASE/*\/}" == "centos" ] then dist="el${IMAGE_TAG}" -elif [ "${IMAGE_BASE}" == "ubuntu" ] +elif [ "${IMAGE_BASE/*\/}" == "ubuntu" ] then dist="${IMAGE_BASE}${IMAGE_TAG}" -elif [ "${IMAGE_BASE}" == "debian" ] +elif [ "${IMAGE_BASE/*\/}" == "debian" ] then dist="${IMAGE_BASE}${IMAGE_TAG}" fi diff --git a/utils/install-common.sh b/utils/install-common.sh index c5b21a693..ae52ac9bd 100755 --- a/utils/install-common.sh +++ b/utils/install-common.sh @@ -39,11 +39,11 @@ install_openresty_deb() { DEBIAN_FRONTEND=noninteractive apt-get install -y libreadline-dev lsb-release libpcre3 libpcre3-dev libldap2-dev libssl-dev perl build-essential DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends wget gnupg ca-certificates wget -O - https://openresty.org/package/pubkey.gpg | apt-key add - - if [[ $IMAGE_BASE == "ubuntu" ]]; then + if [[ "${IMAGE_BASE/*\/}" == "ubuntu" ]]; then echo "deb http://openresty.org/package/${arch_path}ubuntu $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/openresty.list fi - if [[ $IMAGE_BASE == "debian" ]]; then + if [[ "${IMAGE_BASE/*\/}" == "debian" ]]; then echo "deb http://openresty.org/package/${arch_path}debian $(lsb_release -sc) openresty" | tee /etc/apt/sources.list.d/openresty.list fi DEBIAN_FRONTEND=noninteractive apt-get update