2020-07-28 06:09:58 -04:00
|
|
|
#!/usr/bin/env bash
|
2020-09-11 00:15:49 -04:00
|
|
|
. ./env_var.sh
|
2025-08-07 06:28:34 -04:00
|
|
|
Red='\033[0;31m' # Red
|
|
|
|
|
Color_Off='\033[0m' # Text Reset
|
2020-09-11 00:15:49 -04:00
|
|
|
|
2025-08-07 06:28:34 -04:00
|
|
|
ERPLIBRE_IMAGE_NAME=$(cat .erplibre-semver-version | xargs)
|
|
|
|
|
ERPLIBRE_VERSION_MAIN=$(cat .erplibre-version | xargs)
|
|
|
|
|
ODOO_VERSION=$(cat .odoo-version | xargs)
|
|
|
|
|
PYTHON_VERSION=$(cat .python-odoo-version | xargs)
|
|
|
|
|
POETRY_VERSION=$(cat .poetry-version | xargs)
|
2024-08-25 15:54:24 -04:00
|
|
|
|
2020-10-25 02:01:52 -04:00
|
|
|
ARGS=""
|
2020-11-21 00:10:55 -05:00
|
|
|
IS_RELEASE=false
|
2023-01-12 16:09:27 -05:00
|
|
|
IS_RELEASE_ALPHA=false
|
|
|
|
|
IS_RELEASE_BETA=false
|
2020-11-21 00:10:55 -05:00
|
|
|
ERPLIBRE_DOCKER_BASE="technolibre/erplibre-base"
|
|
|
|
|
ERPLIBRE_DOCKER_PROD="technolibre/erplibre"
|
2020-10-25 02:01:52 -04:00
|
|
|
|
2024-08-25 15:54:24 -04:00
|
|
|
output_version=""
|
|
|
|
|
|
2025-08-07 06:28:34 -04:00
|
|
|
for arg in "$@"; do
|
|
|
|
|
if [ "$arg" == "--no-cache" ]; then
|
|
|
|
|
ARGS="${ARGS} --no-cache"
|
|
|
|
|
elif [ "$arg" == "--release" ]; then
|
|
|
|
|
IS_RELEASE=true
|
|
|
|
|
elif [ "$arg" == "--release_alpha" ]; then
|
|
|
|
|
IS_RELEASE_ALPHA=true
|
|
|
|
|
elif [ "$arg" == "--release_beta" ]; then
|
|
|
|
|
IS_RELEASE_BETA=true
|
|
|
|
|
elif [ "$arg" == "--odoo_18" ]; then
|
|
|
|
|
output_version=$(python ./script/version/get_version.py --odoo_version 18.0)
|
|
|
|
|
elif [ "$arg" == "--odoo_17" ]; then
|
|
|
|
|
output_version=$(python ./script/version/get_version.py --odoo_version 17.0)
|
|
|
|
|
elif [ "$arg" == "--odoo_16" ]; then
|
|
|
|
|
output_version=$(python ./script/version/get_version.py --odoo_version 16.0)
|
|
|
|
|
elif [ "$arg" == "--odoo_15" ]; then
|
|
|
|
|
output_version=$(python ./script/version/get_version.py --odoo_version 15.0)
|
|
|
|
|
elif [ "$arg" == "--odoo_14" ]; then
|
|
|
|
|
output_version=$(python ./script/version/get_version.py --odoo_version 14.0)
|
|
|
|
|
elif [ "$arg" == "--odoo_13" ]; then
|
|
|
|
|
output_version=$(python ./script/version/get_version.py --odoo_version 13.0)
|
|
|
|
|
elif [ "$arg" == "--odoo_12" ]; then
|
|
|
|
|
output_version=$(python ./script/version/get_version.py --odoo_version 12.0)
|
|
|
|
|
fi
|
2020-10-25 02:01:52 -04:00
|
|
|
done
|
|
|
|
|
|
2024-08-25 15:54:24 -04:00
|
|
|
if [ "$output_version" != "" ]; then
|
2025-08-07 06:28:34 -04:00
|
|
|
ODOO_VERSION=$(echo "$output_version" | awk 'NR==1')
|
|
|
|
|
POETRY_VERSION=$(echo "$output_version" | awk 'NR==2')
|
|
|
|
|
PYTHON_VERSION=$(echo "$output_version" | awk 'NR==3')
|
|
|
|
|
ERPLIBRE_VERSION_MAIN=$(echo "$output_version" | awk 'NR==4')
|
2024-08-25 15:54:24 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Build with"
|
|
|
|
|
echo $ERPLIBRE_VERSION_MAIN
|
|
|
|
|
echo $ODOO_VERSION
|
|
|
|
|
echo $PYTHON_VERSION
|
|
|
|
|
echo $POETRY_VERSION
|
|
|
|
|
|
2025-08-07 06:28:34 -04:00
|
|
|
if [ "$IS_RELEASE_ALPHA" == true ]; then
|
2023-01-12 16:09:27 -05:00
|
|
|
# Add commit hash when release alpha
|
2024-12-04 02:21:53 -05:00
|
|
|
ERPLIBRE_VERSION="${ERPLIBRE_VERSION}_ALPHA_odoo_${ODOO_VERSION}_$(git rev-parse --short HEAD)"
|
2025-08-07 06:28:34 -04:00
|
|
|
elif [ "$IS_RELEASE_BETA" == true ]; then
|
2023-01-12 16:09:27 -05:00
|
|
|
# Add commit hash when release beta
|
2024-12-04 02:21:53 -05:00
|
|
|
ERPLIBRE_VERSION="${ERPLIBRE_VERSION}_BETA_odoo_${ODOO_VERSION}_$(git rev-parse --short HEAD)"
|
2025-08-07 06:28:34 -04:00
|
|
|
elif [ "$IS_RELEASE" == false ]; then
|
2020-11-21 00:10:55 -05:00
|
|
|
# Add commit hash when not a release
|
2024-12-04 02:21:53 -05:00
|
|
|
ERPLIBRE_VERSION="${ERPLIBRE_VERSION}_odoo_${ODOO_VERSION}_$(git rev-parse --short HEAD)"
|
2020-11-21 00:10:55 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
ERPLIBRE_DOCKER_BASE_VERSION="${ERPLIBRE_DOCKER_BASE}:${ERPLIBRE_VERSION}"
|
|
|
|
|
ERPLIBRE_DOCKER_PROD_VERSION="${ERPLIBRE_DOCKER_PROD}:${ERPLIBRE_VERSION}"
|
2024-08-25 15:54:24 -04:00
|
|
|
ERPLIBRE_VERSION_MAIN="odoo${ODOO_VERSION}_python${PYTHON_VERSION}"
|
2020-11-21 00:10:55 -05:00
|
|
|
|
|
|
|
|
echo "Create docker ${ERPLIBRE_DOCKER_PROD_VERSION}"
|
|
|
|
|
|
2020-09-11 00:15:49 -04:00
|
|
|
# Rewrite docker-compose
|
2024-08-25 15:54:24 -04:00
|
|
|
./script/docker/docker_update_version.py --version=${ERPLIBRE_VERSION} --base=${ERPLIBRE_DOCKER_BASE} --prod=${ERPLIBRE_DOCKER_PROD} --ignore_edit_docker
|
|
|
|
|
|
|
|
|
|
ARGS="${ARGS} --build-arg ERPLIBRE_VERSION=${ERPLIBRE_VERSION_MAIN} --build-arg ODOO_VERSION=${ODOO_VERSION} --build-arg POETRY_VERSION=${POETRY_VERSION} --build-arg ERPLIBRE_IMAGE_NAME=${ERPLIBRE_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION}"
|
2021-07-20 00:31:15 -04:00
|
|
|
|
|
|
|
|
retVal=$?
|
|
|
|
|
if [[ $retVal -ne 0 ]]; then
|
2025-08-07 06:28:34 -04:00
|
|
|
echo -e "${Red}Error${Color_Off} ./script/docker/docker_build.sh when execute docker_update_version.py"
|
|
|
|
|
exit 1
|
2021-07-20 00:31:15 -04:00
|
|
|
fi
|
2020-09-11 00:15:49 -04:00
|
|
|
|
2020-07-28 06:09:58 -04:00
|
|
|
cd docker
|
2020-08-02 00:10:34 -04:00
|
|
|
|
2024-08-25 15:54:24 -04:00
|
|
|
ARGS="${ARGS} --build-arg WORKING_BRANCH=$(git rev-parse --abbrev-ref HEAD) --build-arg WORKING_HASH=$(git rev-parse --verify HEAD)"
|
2020-09-11 00:15:49 -04:00
|
|
|
|
[UPD] docker : une seule base, bookworm, pour toutes les versions d'Odoo
Odoo 13, 14 et 15 bâtissaient encore sur bullseye, dont le dépôt de sécurité
est démantelé. Rien ne les y obligeait : la base est
« python:<version>-slim-<version Debian> », donc l'interpréteur vient de
l'image officielle et non de Debian — les variantes bookworm existent jusqu'à
3.7.17. L'aiguillage portait en outre une branche « buster » INATTEIGNABLE,
sa condition étant la négation de celle qui la précédait ; elle part avec le
reste. Le build de wkhtmltopdf suit la version : celui de bullseye réclame
libssl1.1, absente de bookworm.
Vérifié : les images 3.7.17 et 3.8.20 slim-bookworm existent, le .deb bookworm
rend l'empreinte déclarée, et ses quinze dépendances sont dans bookworm.
--- EN ---
Odoo 13, 14 and 15 still built on bullseye, whose security repository is
dismantled. Nothing required it: the base is
"python:<version>-slim-<suite>", so the interpreter comes from the official
image and not from Debian — the bookworm variants exist down to 3.7.17. The
switch also carried an UNREACHABLE "buster" branch, its condition being the
negation of the one before it; it goes with the rest. The wkhtmltopdf build
follows the suite: bullseye's requires libssl1.1, absent from bookworm.
Checked: the 3.7.17 and 3.8.20 slim-bookworm images exist, the bookworm .deb
matches the declared checksum, and its fifteen dependencies are in bookworm.
Assisted-by: Claude Opus 5
2026-09-24 13:34:22 -04:00
|
|
|
# UNE seule base, bookworm, pour toutes les versions d'Odoo.
|
|
|
|
|
#
|
|
|
|
|
# La base est « python:<version>-slim-<nom> » : le Python vient de l'image
|
|
|
|
|
# officielle, jamais de Debian. Changer de nom de version ne change donc pas
|
|
|
|
|
# l'interpréteur, et les variantes bookworm existent jusqu'à 3.7.17 — vérifié
|
|
|
|
|
# sur le registre. Rien n'obligeait les vieux Odoo à rester sur bullseye, dont
|
|
|
|
|
# le dépôt de sécurité est aujourd'hui démantelé.
|
|
|
|
|
#
|
|
|
|
|
# Le build de wkhtmltopdf suit la version : celui de bullseye réclame
|
|
|
|
|
# libssl1.1, absente de bookworm ; celui de bookworm réclame libssl3, et ses
|
|
|
|
|
# quinze dépendances y sont toutes — vérifié dans l'index.
|
|
|
|
|
ARGS="${ARGS} --build-arg DEBIAN_NAME=bookworm --build-arg URL_WKHTMLTOX=github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb --build-arg SHA1SUM_WKTHMLTOX=e9f95436298c77cc9406bd4bbd242f4771d0a4b2"
|
2020-08-02 00:10:34 -04:00
|
|
|
set -e
|
2020-09-11 00:15:49 -04:00
|
|
|
|
2020-08-02 00:10:34 -04:00
|
|
|
# Build base
|
2025-08-07 06:28:34 -04:00
|
|
|
echo "docker build ${ARGS} -f Dockerfile.base -t ${ERPLIBRE_DOCKER_BASE_VERSION} ."
|
2020-09-11 00:15:49 -04:00
|
|
|
docker build ${ARGS} -f Dockerfile.base -t ${ERPLIBRE_DOCKER_BASE_VERSION} .
|
2020-08-02 00:10:34 -04:00
|
|
|
|
|
|
|
|
# Build prod
|
2025-08-07 06:28:34 -04:00
|
|
|
echo "docker build ${ARGS} -f Dockerfile.prod.pkg -t ${ERPLIBRE_DOCKER_PROD_VERSION} ."
|
2020-09-11 00:15:49 -04:00
|
|
|
docker build ${ARGS} -f Dockerfile.prod.pkg -t ${ERPLIBRE_DOCKER_PROD_VERSION} .
|
2020-08-02 00:10:34 -04:00
|
|
|
|
2020-09-11 00:15:49 -04:00
|
|
|
cd -
|
2024-04-22 23:45:53 -04:00
|
|
|
docker compose up -d
|