From 99f07df6231f71814eef46b8c4380d53ca0715d4 Mon Sep 17 00:00:00 2001 From: Kipchumba Bett Date: Thu, 21 Nov 2024 16:04:22 +0300 Subject: [PATCH] OZ-573: Add environment variable substitution for CSV files in initializer data directory (#4) --- Dockerfile | 2 +- resources/entrypoint.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e34cd8..ff3cfa3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ ARG ODOO_BRANCH=14.0 # Install dependencies RUN apt update && apt install -y git npm postgresql-client python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev \ - libtiff5-dev zlib1g-dev libfreetype6-dev wait-for-it xvfb libfontconfig fontconfig wget \ + libtiff5-dev zlib1g-dev libfreetype6-dev wait-for-it xvfb libfontconfig moreutils fontconfig wget \ liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev gettext-base unzip xfonts-75dpi xfonts-base RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \ wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_${arch}.deb && \ diff --git a/resources/entrypoint.sh b/resources/entrypoint.sh index a6b9799..c17fc85 100755 --- a/resources/entrypoint.sh +++ b/resources/entrypoint.sh @@ -33,6 +33,13 @@ if [ -d /etc/properties ]; then done fi +# env vars substitution for csv files in ${INITIALIZER_DATA_FILES_PATH} directory +if [ -d "${INITIALIZER_DATA_FILES_PATH}" ]; then + for file in "${INITIALIZER_DATA_FILES_PATH}"/**/*.csv; do + envsubst < "${file}" | sponge "${file}" + done +fi + extra_addons="" if [ ! -z "$ADDONS_LIST" ]; then addonsList="-i $ADDONS_LIST" @@ -60,4 +67,4 @@ case "$1" in exec "$@" esac -exit 1 \ No newline at end of file +exit 1