From 62eeabff2b89f791250ccb40a91076fe1c700b80 Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Fri, 20 Sep 2024 02:07:12 +0300 Subject: [PATCH] bump Angie version adjust versions across scripts/dockerfiles --- Dockerfile | 5 +++-- Dockerfile.deps | 3 ++- build-scripts/image-base.sh | 4 +++- build-scripts/image-deps.sh | 7 +++++-- build-scripts/image.sh | 13 ++++++++----- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index c6bfa40..98d88e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM docker.io/rockdrilla/angie-conv:v0.0.1-deps AS deps +ARG IMAGE_VERSION +FROM docker.io/rockdrilla/angie-conv:${IMAGE_VERSION}-deps AS deps ## --- @@ -109,7 +110,7 @@ RUN apt-install.sh angie ; \ fi ## preserve snippets from Angie config directory -## ref: https://git.angie.software/web-server/angie/src/tag/Angie-1.6.2/conf +## ref: https://git.angie.software/web-server/angie/src/tag/Angie-1.7.0/conf RUN d=/etc/angie ; t=$(mktemp -d) ; \ tar -C "$d" -cf - \ fastcgi_params \ diff --git a/Dockerfile.deps b/Dockerfile.deps index 546a858..2cee13d 100644 --- a/Dockerfile.deps +++ b/Dockerfile.deps @@ -1,4 +1,5 @@ -FROM docker.io/rockdrilla/angie-conv:v0.0.1-base AS base +ARG IMAGE_VERSION +FROM docker.io/rockdrilla/angie-conv:${IMAGE_VERSION}-base AS base ## --- diff --git a/build-scripts/image-base.sh b/build-scripts/image-base.sh index ca6988b..dad5f4d 100755 --- a/build-scripts/image-base.sh +++ b/build-scripts/image-base.sh @@ -2,6 +2,8 @@ set -ef cd "$(dirname "$0")/.." +IMAGE_VERSION="${IMAGE_VERSION:-v0.0.1}" + set -a BUILDAH_FORMAT="${BUILDAH_FORMAT:-docker}" BUILDAH_ISOLATION="${BUILDAH_ISOLATION:-chroot}" @@ -27,7 +29,7 @@ grab_site_packages() { PYTHON_SITE_PACKAGES=$(grab_site_packages "docker.io/python:${PYTHONTAG}") [ -n "${PYTHON_SITE_PACKAGES:?}" ] -img="docker.io/rockdrilla/angie-conv:v0.0.1-base" +img="docker.io/rockdrilla/angie-conv:${IMAGE_VERSION}-base" buildah bud --network="${BUILDAH_NETWORK}" \ -f ./Dockerfile.base \ diff --git a/build-scripts/image-deps.sh b/build-scripts/image-deps.sh index 53da228..9356990 100755 --- a/build-scripts/image-deps.sh +++ b/build-scripts/image-deps.sh @@ -2,15 +2,18 @@ set -ef cd "$(dirname "$0")/.." +IMAGE_VERSION="${IMAGE_VERSION:-v0.0.1}" + set -a BUILDAH_FORMAT="${BUILDAH_FORMAT:-docker}" BUILDAH_ISOLATION="${BUILDAH_ISOLATION:-chroot}" BUILDAH_NETWORK="${BUILDAH_NETWORK:-host}" set +a -img="docker.io/rockdrilla/angie-conv:v0.0.1-deps" +img="docker.io/rockdrilla/angie-conv:${IMAGE_VERSION}-deps" exec buildah bud \ -f ./Dockerfile.deps \ -t "${img}" \ - --pull=missing --no-cache + --pull=missing --no-cache \ + --build-arg "IMAGE_VERSION=${IMAGE_VERSION}" \ diff --git a/build-scripts/image.sh b/build-scripts/image.sh index 7623552..9777250 100755 --- a/build-scripts/image.sh +++ b/build-scripts/image.sh @@ -2,13 +2,15 @@ set -ef cd "$(dirname "$0")/.." +IMAGE_VERSION="${IMAGE_VERSION:-v0.0.1}" + set -a BUILDAH_FORMAT="${BUILDAH_FORMAT:-docker}" BUILDAH_ISOLATION="${BUILDAH_ISOLATION:-chroot}" BUILDAH_NETWORK="${BUILDAH_NETWORK:-host}" set +a -ANGIE_VERSION="${ANGIE_VERSION:-1.6.2}" +ANGIE_VERSION="${ANGIE_VERSION:-1.7.0}" ## likely the same as in https://pkg.go.dev/strconv#ParseBool gobool_to_int() { @@ -21,10 +23,10 @@ gobool_to_int() { esac } -NGX_DEBUG=$(gobool_to_int "${1:-0}" 0) +NGX_DEBUG=$(gobool_to_int "${NGX_DEBUG:-0}" 0) case "${NGX_DEBUG}" in -0 ) img="docker.io/rockdrilla/angie-conv:v0.0.1-${ANGIE_VERSION}" ;; -1 ) img="docker.io/rockdrilla/angie-conv:v0.0.1-${ANGIE_VERSION}-debug" ;; +0 ) img="docker.io/rockdrilla/angie-conv:${IMAGE_VERSION}-${ANGIE_VERSION}" ;; +1 ) img="docker.io/rockdrilla/angie-conv:${IMAGE_VERSION}-${ANGIE_VERSION}-debug" ;; esac exec buildah bud \ @@ -32,4 +34,5 @@ exec buildah bud \ -t "${img}" \ --env "ANGIE_VERSION=${ANGIE_VERSION}" \ --env "NGX_DEBUG=${NGX_DEBUG}" \ - --pull=missing --no-cache + --pull=missing --no-cache \ + --build-arg "IMAGE_VERSION=${IMAGE_VERSION}" \