From ce0cfef9a9f5c930c43c0591dd8e17ebb7a850d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Sep 2024 04:00:51 +0200 Subject: [PATCH] Fix use of version to find the demo init file --- Dockerfile.template | 1 + images/15.0.3-php7.4/Dockerfile | 5 ++++- images/16.0.5-php8.1/Dockerfile | 5 ++++- images/17.0.4-php8.1/Dockerfile | 5 ++++- images/18.0.5-php8.1/Dockerfile | 5 ++++- images/19.0.3-php8.2/Dockerfile | 5 ++++- images/develop/Dockerfile | 7 +++++-- update.sh | 13 ++++++++----- 8 files changed, 34 insertions(+), 12 deletions(-) diff --git a/Dockerfile.template b/Dockerfile.template index a37e0d3..a270930 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -4,6 +4,7 @@ ARG ARCH= FROM ${ARCH}php:%PHP_BASE_IMAGE% # Credit/Initial maintainer: Garcia MICHEL +# Modified according the GPL license by developers of the Dolibarr community. #LABEL maintainer="Garcia MICHEL " LABEL maintainer="The Dolibarr foundation " diff --git a/images/15.0.3-php7.4/Dockerfile b/images/15.0.3-php7.4/Dockerfile index c35815c..0c51e37 100644 --- a/images/15.0.3-php7.4/Dockerfile +++ b/images/15.0.3-php7.4/Dockerfile @@ -3,7 +3,10 @@ ARG ARCH= # Use an image like PHP_BASE_IMAGE=x.y-apache-buster FROM ${ARCH}php:7.4-apache-buster -LABEL maintainer="Garcia MICHEL " +# Credit/Initial maintainer: Garcia MICHEL +# Modified according the GPL license by developers of the Dolibarr community. +#LABEL maintainer="Garcia MICHEL " +LABEL maintainer="The Dolibarr foundation " ENV DOLI_VERSION 15.0.3 ENV DOLI_VERSION_FOR_INIT_DEMO 15.0 diff --git a/images/16.0.5-php8.1/Dockerfile b/images/16.0.5-php8.1/Dockerfile index c99ff93..f524138 100644 --- a/images/16.0.5-php8.1/Dockerfile +++ b/images/16.0.5-php8.1/Dockerfile @@ -3,7 +3,10 @@ ARG ARCH= # Use an image like PHP_BASE_IMAGE=x.y-apache-buster FROM ${ARCH}php:8.1-apache-buster -LABEL maintainer="Garcia MICHEL " +# Credit/Initial maintainer: Garcia MICHEL +# Modified according the GPL license by developers of the Dolibarr community. +#LABEL maintainer="Garcia MICHEL " +LABEL maintainer="The Dolibarr foundation " ENV DOLI_VERSION 16.0.5 ENV DOLI_VERSION_FOR_INIT_DEMO 16.0 diff --git a/images/17.0.4-php8.1/Dockerfile b/images/17.0.4-php8.1/Dockerfile index 6b89007..5c0301b 100644 --- a/images/17.0.4-php8.1/Dockerfile +++ b/images/17.0.4-php8.1/Dockerfile @@ -3,7 +3,10 @@ ARG ARCH= # Use an image like PHP_BASE_IMAGE=x.y-apache-buster FROM ${ARCH}php:8.1-apache-buster -LABEL maintainer="Garcia MICHEL " +# Credit/Initial maintainer: Garcia MICHEL +# Modified according the GPL license by developers of the Dolibarr community. +#LABEL maintainer="Garcia MICHEL " +LABEL maintainer="The Dolibarr foundation " ENV DOLI_VERSION 17.0.4 ENV DOLI_VERSION_FOR_INIT_DEMO 17.0 diff --git a/images/18.0.5-php8.1/Dockerfile b/images/18.0.5-php8.1/Dockerfile index ea2d46c..7c6bbec 100644 --- a/images/18.0.5-php8.1/Dockerfile +++ b/images/18.0.5-php8.1/Dockerfile @@ -3,7 +3,10 @@ ARG ARCH= # Use an image like PHP_BASE_IMAGE=x.y-apache-buster FROM ${ARCH}php:8.1-apache-buster -LABEL maintainer="Garcia MICHEL " +# Credit/Initial maintainer: Garcia MICHEL +# Modified according the GPL license by developers of the Dolibarr community. +#LABEL maintainer="Garcia MICHEL " +LABEL maintainer="The Dolibarr foundation " ENV DOLI_VERSION 18.0.5 ENV DOLI_VERSION_FOR_INIT_DEMO 18.0 diff --git a/images/19.0.3-php8.2/Dockerfile b/images/19.0.3-php8.2/Dockerfile index c30b070..36e63b8 100644 --- a/images/19.0.3-php8.2/Dockerfile +++ b/images/19.0.3-php8.2/Dockerfile @@ -3,7 +3,10 @@ ARG ARCH= # Use an image like PHP_BASE_IMAGE=x.y-apache-buster FROM ${ARCH}php:8.2-apache-buster -LABEL maintainer="Garcia MICHEL " +# Credit/Initial maintainer: Garcia MICHEL +# Modified according the GPL license by developers of the Dolibarr community. +#LABEL maintainer="Garcia MICHEL " +LABEL maintainer="The Dolibarr foundation " ENV DOLI_VERSION 19.0.3 ENV DOLI_VERSION_FOR_INIT_DEMO 19.0 diff --git a/images/develop/Dockerfile b/images/develop/Dockerfile index 1098d18..3e387d5 100644 --- a/images/develop/Dockerfile +++ b/images/develop/Dockerfile @@ -3,10 +3,13 @@ ARG ARCH= # Use an image like PHP_BASE_IMAGE=x.y-apache-buster FROM ${ARCH}php:8.2-apache-buster -LABEL maintainer="Garcia MICHEL " +# Credit/Initial maintainer: Garcia MICHEL +# Modified according the GPL license by developers of the Dolibarr community. +#LABEL maintainer="Garcia MICHEL " +LABEL maintainer="The Dolibarr foundation " ENV DOLI_VERSION develop -ENV DOLI_VERSION_FOR_INIT_DEMO develop +ENV DOLI_VERSION_FOR_INIT_DEMO 20.0 ENV DOLI_INSTALL_AUTO 1 ENV DOLI_PROD 1 diff --git a/update.sh b/update.sh index bf78da8..bad5f19 100755 --- a/update.sh +++ b/update.sh @@ -35,7 +35,7 @@ for dolibarrVersion in "${DOLIBARR_VERSIONS[@]}"; do # Mapping PHP version according Dolibarr version (See https://wiki.dolibarr.org/index.php/Versions) # Regarding PHP Supported version : https://www.php.net/supported-versions.php - if [ "${dolibarrVersion}" = "develop" ] || [ "${dolibarrMajor}" -ge "19" ] || [ "${dolibarrMajor}" -ge "20" ]; then + if [ "${dolibarrVersion}" = "develop" ] || [ "${dolibarrMajor}" -ge "19" ] || [ "${dolibarrMajor}" -ge "20" ] || [ "${dolibarrMajor}" -ge "21" ]; then php_base_images=( "8.2-apache-buster" ) elif [ "${dolibarrMajor}" -ge "16" ]; then php_base_images=( "8.1-apache-buster" ) @@ -63,15 +63,18 @@ for dolibarrVersion in "${DOLIBARR_VERSIONS[@]}"; do dir="${BASE_DIR}/images/${currentTag}" - # Set DOLIBARR_VERSION_FOR_INIT_DEMO to x.y version - if [ ${dolibarrVersion} != "dolibarr" ]; then - DOLIBARR_VERSION_FOR_INIT_DEMO=$(echo "${dolibarrVersion}" | sed 's/\(\.[^\.]*\)\.[^\.]*$/\1/') + # Set DOLI_VERSION_FOR_INIT_DEMO to x.y version + if [ ${dolibarrVersion} != "develop" ]; then + DOLI_VERSION_FOR_INIT_DEMO=$(echo "${dolibarrVersion}" | sed 's/\(\.[^\.]*\)\.[^\.]*$/\1/') + else + DOLI_VERSION_FOR_INIT_DEMO=$DOLIBARR_VERSION_FOR_INIT_DEMO fi + echo "Replace Dockerfile.template with DOLI_VERSION_FOR_INIT_DEMO=$DOLI_VERSION_FOR_INIT_DEMO" mkdir -p "${dir}" sed 's/%PHP_BASE_IMAGE%/'"${php_base_image}"'/;' "${BASE_DIR}/Dockerfile.template" | \ sed 's/%DOLI_VERSION%/'"${dolibarrVersion}"'/;' | \ - sed 's/%DOLI_VERSION_FOR_INIT_DEMO%/'"${DOLIBARR_VERSION_FOR_INIT_DEMO}"'/;' \ + sed 's/%DOLI_VERSION_FOR_INIT_DEMO%/'"${DOLI_VERSION_FOR_INIT_DEMO}"'/;' \ > "${dir}/Dockerfile" cp -a "${BASE_DIR}/docker-init.php" "${dir}/docker-init.php"