Skip to content

Commit

Permalink
Fix use of version to find the demo init file
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 13, 2024
1 parent c97f91a commit ce0cfef
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 12 deletions.
1 change: 1 addition & 0 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ARG ARCH=
FROM ${ARCH}php:%PHP_BASE_IMAGE%

# Credit/Initial maintainer: Garcia MICHEL <[email protected]>
# Modified according the GPL license by developers of the Dolibarr community.
#LABEL maintainer="Garcia MICHEL <[email protected]>"
LABEL maintainer="The Dolibarr foundation <[email protected]>"

Expand Down
5 changes: 4 additions & 1 deletion images/15.0.3-php7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
# Credit/Initial maintainer: Garcia MICHEL <[email protected]>
# Modified according the GPL license by developers of the Dolibarr community.
#LABEL maintainer="Garcia MICHEL <[email protected]>"
LABEL maintainer="The Dolibarr foundation <[email protected]>"

ENV DOLI_VERSION 15.0.3
ENV DOLI_VERSION_FOR_INIT_DEMO 15.0
Expand Down
5 changes: 4 additions & 1 deletion images/16.0.5-php8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
# Credit/Initial maintainer: Garcia MICHEL <[email protected]>
# Modified according the GPL license by developers of the Dolibarr community.
#LABEL maintainer="Garcia MICHEL <[email protected]>"
LABEL maintainer="The Dolibarr foundation <[email protected]>"

ENV DOLI_VERSION 16.0.5
ENV DOLI_VERSION_FOR_INIT_DEMO 16.0
Expand Down
5 changes: 4 additions & 1 deletion images/17.0.4-php8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
# Credit/Initial maintainer: Garcia MICHEL <[email protected]>
# Modified according the GPL license by developers of the Dolibarr community.
#LABEL maintainer="Garcia MICHEL <[email protected]>"
LABEL maintainer="The Dolibarr foundation <[email protected]>"

ENV DOLI_VERSION 17.0.4
ENV DOLI_VERSION_FOR_INIT_DEMO 17.0
Expand Down
5 changes: 4 additions & 1 deletion images/18.0.5-php8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
# Credit/Initial maintainer: Garcia MICHEL <[email protected]>
# Modified according the GPL license by developers of the Dolibarr community.
#LABEL maintainer="Garcia MICHEL <[email protected]>"
LABEL maintainer="The Dolibarr foundation <[email protected]>"

ENV DOLI_VERSION 18.0.5
ENV DOLI_VERSION_FOR_INIT_DEMO 18.0
Expand Down
5 changes: 4 additions & 1 deletion images/19.0.3-php8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
# Credit/Initial maintainer: Garcia MICHEL <[email protected]>
# Modified according the GPL license by developers of the Dolibarr community.
#LABEL maintainer="Garcia MICHEL <[email protected]>"
LABEL maintainer="The Dolibarr foundation <[email protected]>"

ENV DOLI_VERSION 19.0.3
ENV DOLI_VERSION_FOR_INIT_DEMO 19.0
Expand Down
7 changes: 5 additions & 2 deletions images/develop/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"
# Credit/Initial maintainer: Garcia MICHEL <[email protected]>
# Modified according the GPL license by developers of the Dolibarr community.
#LABEL maintainer="Garcia MICHEL <[email protected]>"
LABEL maintainer="The Dolibarr foundation <[email protected]>"

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

Expand Down
13 changes: 8 additions & 5 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit ce0cfef

Please sign in to comment.