Skip to content
Extraits de code Groupes Projets
Valider b5657d35 rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[INIT] create 15.0 branch from 16.0

parent 7050c8ea
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -5,7 +5,7 @@
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
image: docker:20.10.17
image: docker:20.10.21
include:
- template: Security/Container-Scanning.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
......@@ -14,10 +14,10 @@ container_scanning:
DOCKER_IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH"
DOCKERFILE_PATH: "$CI_COMMIT_BRANCH.Dockerfile"
docker-build-10.0:
image: docker:20.10.17
image: docker:20.10.21
stage: build
services:
- docker:20.10.17-dind
- docker:20.10.21-dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
......@@ -26,10 +26,10 @@ docker-build-10.0:
only:
- '10.0'
docker-build-12.0:
image: docker:20.10.17
image: docker:20.10.21
stage: build
services:
- docker:20.10.17-dind
- docker:20.10.21-dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
......@@ -43,10 +43,10 @@ docker-build-12.0:
only:
- '12.0'
docker-build-14.0:
image: docker:20.10.17
image: docker:20.10.21
stage: build
services:
- docker:20.10.17-dind
- docker:20.10.21-dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
......@@ -54,11 +54,23 @@ docker-build-14.0:
- docker push "$CI_REGISTRY_IMAGE:14.0"
only:
- '14.0'
docker-build-15.0:
image: docker:20.10.21
stage: build
services:
- docker:20.10.21-dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -f 15.0.Dockerfile -t "$CI_REGISTRY_IMAGE:15.0" .
- docker push "$CI_REGISTRY_IMAGE:15.0"
only:
- '16.0'
docker-build-16.0:
image: docker:20.10.17
image: docker:20.10.21
stage: build
services:
- docker:20.10.17-dind
- docker:20.10.21-dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
......@@ -67,10 +79,10 @@ docker-build-16.0:
only:
- '16.0'
docker-build-16.0-scratch:
image: docker:20.10.17
image: docker:20.10.21
stage: build
services:
- docker:20.10.17-dind
- docker:20.10.21-dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
......
......@@ -3,7 +3,7 @@ RUN set -x; \
apt-get update &&\
apt-get install -y --no-install-recommends build-essential libldap2-dev libpq-dev libsasl2-dev &&\
pip install wheel &&\
pip wheel --wheel-dir=/svc/wheels -r https://raw.githubusercontent.com/oca/OCB/16.0/requirements.txt &&\
pip wheel --wheel-dir=/svc/wheels -r https://raw.githubusercontent.com/oca/OCB/15.0/requirements.txt &&\
pip wheel --wheel-dir=/svc/wheels phonenumbers simplejson openupgradelib PyYAML
......@@ -31,7 +31,7 @@ RUN set -x; \
rm -rf /var/lib/apt/lists/* wkhtmltox.deb
COPY --from=builder /svc /svc
RUN pip3 install --no-index --find-links=/svc/wheels -r https://raw.githubusercontent.com/oca/OCB/16.0/requirements.txt &&\
RUN pip3 install --no-index --find-links=/svc/wheels -r https://raw.githubusercontent.com/oca/OCB/15.0/requirements.txt &&\
pip3 install --no-index --find-links=/svc/wheels phonenumbers simplejson openupgradelib PyYAML
# Add Git Known Hosts
......@@ -41,7 +41,7 @@ COPY ./ssh_known_git_hosts /root/.ssh/known_hosts
RUN set -x; \
useradd --create-home --home-dir /opt/odoo --no-log-init odoo &&\
/bin/bash -c "mkdir -p /opt/odoo/{etc,odoo,additional_addons,private_addons,data,private}" &&\
git clone -b 16.0 --depth 1 https://github.com/OCA/OCB.git /opt/odoo/odoo &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/OCB.git /opt/odoo/odoo &&\
rm -rf /opt/odoo/odoo/.git &&\
find /opt/odoo/odoo/addons/*/i18n/ /opt/odoo/odoo/odoo/addons/base/i18n/ -type f -not -name 'fr.po' -delete &&\
chown -R odoo:odoo /opt/odoo
......@@ -49,68 +49,58 @@ RUN set -x; \
# Install Odoo OCA default dependencies - Commented modules do not exist yet
RUN set -x; \
mkdir -p /tmp/oca-repos/ &&\
git clone -b 16.0 --depth 1 https://github.com/OCA/account-financial-reporting.git /tmp/oca-repos/account-financial-reporting &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/account-financial-reporting.git /tmp/oca-repos/account-financial-reporting &&\
mv /tmp/oca-repos/account-financial-reporting/account_tax_balance /opt/odoo/additional_addons/ &&\
# git clone -b 16.0 --depth 1 https://github.com/OCA/account-financial-tools.git /tmp/oca-repos/account-financial-tools &&\
# mv /tmp/oca-repos/account-financial-tools/account_lock_date_update \
# /tmp/oca-repos/account-financial-tools/account_move_name_sequence \
# /tmp/oca-repos/account-financial-tools/account_reconcile_show_boolean \
# /opt/odoo/additional_addons/ &&\
# git clone -b 16.0 --depth 1 https://github.com/OCA/account-invoicing.git /tmp/oca-repos/account-invoicing &&\
# mv /tmp/oca-repos/account-invoicing/sale_timesheet_invoice_description \
# /opt/odoo/additional_addons/ &&\
# git clone -b 16.0 --depth 1 https://github.com/OCA/account-reconcile.git /tmp/oca-repos/account-reconcile &&\
# mv /tmp/oca-repos/account-reconcile/account_reconciliation_widget \
# /opt/odoo/additional_addons/ &&\
# git clone -b 16.0 --depth 1 https://github.com/OCA/bank-statement-import.git /tmp/oca-repos/bank-statement-import &&\
# mv /tmp/oca-repos/bank-statement-import/account_statement_import \
# /tmp/oca-repos/bank-statement-import/account_statement_import_ofx \
# /opt/odoo/additional_addons/ &&\
# git clone -b 16.0 --depth 1 https://github.com/OCA/crm.git /tmp/oca-repos/crm &&\
# mv /tmp/oca-repos/crm/crm_stage_probability /opt/odoo/additional_addons/ &&\
git clone -b 16.0 --depth 1 https://github.com/OCA/partner-contact.git /tmp/oca-repos/partner-contact &&\
mv /tmp/oca-repos/partner-contact/partner_disable_gravatar \
/tmp/oca-repos/partner-contact/partner_firstname \
git clone -b 15.0 --depth 1 https://github.com/OCA/account-financial-tools.git /tmp/oca-repos/account-financial-tools &&\
mv /tmp/oca-repos/account-financial-tools/account_lock_date_update \
/tmp/oca-repos/account-financial-tools/account_move_name_sequence \
/opt/odoo/additional_addons/ &&\
git clone -b 16.0 --depth 1 https://github.com/OCA/project.git /tmp/oca-repos/project &&\
# mv /tmp/oca-repos/project/project_category \
# /tmp/oca-repos/project/project_status \
mv /tmp/oca-repos/project/project_task_default_stage \
git clone -b 15.0 --depth 1 https://github.com/OCA/account-invoicing.git /tmp/oca-repos/account-invoicing &&\
mv /tmp/oca-repos/account-invoicing/sale_timesheet_invoice_description \
/opt/odoo/additional_addons/ &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/account-reconcile.git /tmp/oca-repos/account-reconcile &&\
mv /tmp/oca-repos/account-reconcile/account_reconciliation_widget \
/opt/odoo/additional_addons/ &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/bank-statement-import.git /tmp/oca-repos/bank-statement-import &&\
mv /tmp/oca-repos/bank-statement-import/account_statement_import \
/opt/odoo/additional_addons/ &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/crm.git /tmp/oca-repos/crm &&\
mv /tmp/oca-repos/crm/crm_stage_probability /opt/odoo/additional_addons/ &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/partner-contact.git /tmp/oca-repos/partner-contact &&\
mv /tmp/oca-repos/partner-contact/partner_firstname \
/opt/odoo/additional_addons/ &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/project.git /tmp/oca-repos/project &&\
mv /tmp/oca-repos/project/project_status \
/tmp/oca-repos/project/project_task_default_stage \
/tmp/oca-repos/project/project_template \
# /tmp/oca-repos/project/project_timeline \
/tmp/oca-repos/project/project_timeline \
/opt/odoo/additional_addons/ &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/server-brand.git /tmp/oca-repos/server-brand &&\
mv /tmp/oca-repos/server-brand/disable_odoo_online \
/tmp/oca-repos/server-brand/remove_odoo_enterprise \
/opt/odoo/additional_addons/ &&\
# git clone -b 16.0 --depth 1 https://github.com/OCA/server-auth.git /tmp/oca-repos/server-auth &&\
# mv /tmp/oca-repos/server-auth/password_security \
# /opt/odoo/additional_addons/ &&\
# git clone -b 16.0 --depth 1 https://github.com/OCA/server-brand.git /tmp/oca-repos/server-brand &&\
# mv /tmp/oca-repos/server-brand/disable_odoo_online \
# /tmp/oca-repos/server-brand/remove_odoo_enterprise \
# /opt/odoo/additional_addons/ &&\
git clone -b 16.0 --depth 1 https://github.com/OCA/server-tools.git /tmp/oca-repos/server-tools &&\
# mv /tmp/oca-repos/server-tools/base_search_fuzzy \
mv /tmp/oca-repos/server-tools/module_change_auto_install \
git clone -b 15.0 --depth 1 https://github.com/OCA/server-tools.git /tmp/oca-repos/server-tools &&\
mv /tmp/oca-repos/server-tools/base_search_fuzzy \
/tmp/oca-repos/server-tools/module_change_auto_install \
/opt/odoo/additional_addons/ &&\
git clone -b 16.0 --depth 1 https://github.com/OCA/server-ux.git /tmp/oca-repos/server-ux &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/server-ux.git /tmp/oca-repos/server-ux &&\
mv /tmp/oca-repos/server-ux/base_technical_features \
/tmp/oca-repos/server-ux/date_range \
# /tmp/oca-repos/server-ux/mass_editing \
/tmp/oca-repos/server-ux/mass_editing \
/opt/odoo/additional_addons/ &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/social.git /tmp/oca-repos/social &&\
mv /tmp/oca-repos/social/base_search_mail_content \
/tmp/oca-repos/social/mail_debrand \
/tmp/oca-repos/social/mail_tracking \
/opt/odoo/additional_addons/ &&\
# git clone -b 16.0 --depth 1 https://github.com/OCA/social.git /tmp/oca-repos/social &&\
# mv /tmp/oca-repos/social/base_search_mail_content \
# /tmp/oca-repos/social/mail_debrand \
# /tmp/oca-repos/social/mail_tracking \
# /opt/odoo/additional_addons/ &&\
git clone -b 16.0 --depth 1 https://github.com/OCA/web.git /tmp/oca-repos/web &&\
git clone -b 15.0 --depth 1 https://github.com/OCA/web.git /tmp/oca-repos/web &&\
mv /tmp/oca-repos/web/web_environment_ribbon \
# /tmp/oca-repos/web/web_responsive \
# /tmp/oca-repos/web/web_no_bubble \
# /tmp/oca-repos/web/web_timeline \
/tmp/oca-repos/web/web_responsive \
/tmp/oca-repos/web/web_no_bubble \
/tmp/oca-repos/web/web_timeline \
/opt/odoo/additional_addons/ &&\
rm -rf /tmp/oca-repos/ &&\
find /opt/odoo/additional_addons/*/i18n/ -type f -not -name 'fr.po' -delete &&\
# # Install Le Filament default dependency
# git clone -b 16.0 --depth 1 https://sources.le-filament.com/lefilament/remove_login_links.git /opt/odoo/private_addons/remove_login_links &&\
# git clone -b 16.0 --depth 1 https://sources.le-filament.com/lefilament/lefilament_release_agent.git /opt/odoo/private_addons/lefilament_release_agent &&\
chown -R odoo:odoo /opt/odoo
# Copy entrypoint script and Odoo configuration file
......@@ -132,7 +122,7 @@ ENTRYPOINT ["/entrypoint.sh"]
CMD ["odoo"]
# Metadata
LABEL org.label-schema.schema-version="16.0" \
LABEL org.label-schema.schema-version="15.0" \
org.label-schema.vendor=LeFilament \
org.label-schema.license=Apache-2.0 \
org.label-schema.vcs-url="https://sources.le-filament.com/lefilament/odoo_docker"
FROM surnet/alpine-wkhtmltopdf:3.16.0-0.12.6-small as wkhtmltopdf
FROM alpine as build
# Initial setup of new root.
RUN apk update \
&& mkdir --parents \
/newroot/etc \
/newroot/bin \
/newroot/usr/bin \
&& cp -a --parents \
/bin/busybox \
/lib/ld-musl* \
/newroot/ \
&& /bin/busybox --install -s /newroot/bin/ \
&& /bin/busybox --install -s /newroot/usr/bin/ \
&& echo 'root:x:0:0:::' > /newroot/etc/passwd \
&& echo 'root:x:0:' > /newroot/etc/group
# Add depedencies
RUN apk add --no-cache \
file \
freetype-dev \
g++ \
gcc \
git \
jpeg-dev \
libev-dev \
libffi-dev \
libx11-dev \
libxrender-dev \
fontconfig-dev \
make \
musl-dev \
openldap-dev \
postgresql-dev \
py3-pip \
python3 \
python3-dev \
zlib-dev
# Add Odoo.
RUN git clone -b 16.0 --depth 1 https://github.com/OCA/OCB.git /newroot/opt/odoo/odoo \
&& rm -rf /newroot/opt/odoo/odoo/.git \
&& find /newroot/opt/odoo/odoo/addons/*/i18n/ /newroot/opt/odoo/odoo/odoo/addons/base/i18n/ -type f -not -name 'fr.po' -delete
## Add Git known hosts.
COPY ./ssh_known_git_hosts /root/.ssh/known_hosts
## Install Odoo OCA and Le Filament default dependencies.
RUN mkdir -p \
/tmp/oca-repos/ \
/newroot/opt/odoo/additional_addons \
/newroot/opt/odoo/private_addons \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/account-financial-reporting.git \
/tmp/oca-repos/account-financial-reporting \
&& mv /tmp/oca-repos/account-financial-reporting/account_tax_balance \
/newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/account-financial-tools.git \
# /tmp/oca-repos/account-financial-tools \
# && mv /tmp/oca-repos/account-financial-tools/account_lock_date_update \
# /tmp/oca-repos/account-financial-tools/account_move_name_sequence \
# /tmp/oca-repos/account-financial-tools/account_reconcile_show_boolean \
# /newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/account-invoicing.git \
# /tmp/oca-repos/account-invoicing \
# && mv /tmp/oca-repos/account-invoicing/sale_timesheet_invoice_description \
# /newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/account-reconcile.git \
# /tmp/oca-repos/account-reconcile \
# && mv /tmp/oca-repos/account-reconcile/account_reconciliation_widget \
# /newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/bank-statement-import.git \
# /tmp/oca-repos/bank-statement-import \
# && mv /tmp/oca-repos/bank-statement-import/account_statement_import \
# /tmp/oca-repos/bank-statement-import/account_statement_import_ofx \
# /newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/crm.git \
# /tmp/oca-repos/crm \
# && mv /tmp/oca-repos/crm/crm_stage_probability \
# /newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/partner-contact.git \
/tmp/oca-repos/partner-contact \
&& mv /tmp/oca-repos/partner-contact/partner_disable_gravatar \
/tmp/oca-repos/partner-contact/partner_firstname \
/newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/project.git \
/tmp/oca-repos/project \
# && mv /tmp/oca-repos/project/project_category \
# /tmp/oca-repos/project/project_status \
&& mv /tmp/oca-repos/project/project_task_default_stage \
/tmp/oca-repos/project/project_template \
# /tmp/oca-repos/project/project_timeline \
/newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/server-auth.git \
# /tmp/oca-repos/server-auth \
# && mv /tmp/oca-repos/server-auth/password_security \
# /newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/server-brand.git \
# /tmp/oca-repos/server-brand \
# && mv /tmp/oca-repos/server-brand/disable_odoo_online \
# /tmp/oca-repos/server-brand/remove_odoo_enterprise \
# /newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/server-tools.git \
/tmp/oca-repos/server-tools \
# && mv /tmp/oca-repos/server-tools/base_search_fuzzy \
&& mv /tmp/oca-repos/server-tools/module_change_auto_install \
/newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/server-ux.git \
/tmp/oca-repos/server-ux \
&& mv /tmp/oca-repos/server-ux/base_technical_features \
/tmp/oca-repos/server-ux/date_range \
# /tmp/oca-repos/server-ux/mass_editing \
/newroot/opt/odoo/additional_addons/ \
# && git clone -b 16.0 --depth 1 \
# https://github.com/OCA/social.git \
# /tmp/oca-repos/social \
# && mv /tmp/oca-repos/social/base_search_mail_content \
# /tmp/oca-repos/social/mail_debrand \
# /tmp/oca-repos/social/mail_tracking \
# /newroot/opt/odoo/additional_addons/ \
&& git clone -b 16.0 --depth 1 \
https://github.com/OCA/web.git \
/tmp/oca-repos/web \
&& mv /tmp/oca-repos/web/web_environment_ribbon \
# /tmp/oca-repos/web/web_responsive \
# /tmp/oca-repos/web/web_no_bubble \
# /tmp/oca-repos/web/web_timeline \
/newroot/opt/odoo/additional_addons/ \
&& rm -rf /tmp/oca-repos/ \
&& find /newroot/opt/odoo/additional_addons/*/i18n/ -type f -not -name 'fr.po' -delete
# && git clone -b 16.0 --depth 1 \
# https://sources.le-filament.com/lefilament/remove_login_links.git \
# /newroot/opt/odoo/private_addons/remove_login_links \
# && git clone -b 16.0 --depth 1 \
# https://sources.le-filament.com/lefilament/lefilament_release_agent.git \
# /newroot/opt/odoo/private_addons/lefilament_release_agent
# Fix a ldap library bug.
RUN echo -n "INPUT ( libldap.so )" > /usr/lib/libldap_r.so
# Install Python requirements.
RUN pip install --requirement /newroot/opt/odoo/odoo/requirements.txt
# Only copy libraries of needed binaries to new root.
RUN ls \
/lib/libz.so* \
/usr/bin/python3* \
/usr/lib/libexpat.so* \
/usr/lib/libfontconfig.so* \
/usr/lib/libfreetype.so* \
/usr/lib/libjpeg.so* \
/usr/lib/libpq.so* \
/usr/lib/libpython3.so* \
/usr/lib/python3.10/lib-dynload/*.so \
/usr/lib/python3.10/site-packages/*.so \
/usr/lib/libX11.so* \
/usr/lib/libXrender.so* \
> to_copy \
&& xargs -a to_copy -I R ldd R \
| tr -s '[:blank:]' '\n' \
| grep '^/' \
| sed 's/://' \
| sort -u \
| xargs cp -aL --parents -t /newroot/ \
&& xargs -a to_copy cp -a --parents -t /newroot/
# Copy Python libraries.
RUN cp -a --parents \
/usr/lib/python3.10/ \
/newroot
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /newroot/bin/wkhtmltopdf
COPY ./entrypoint-scratch.sh /newroot/entrypoint.sh
# Add odoo user.
RUN echo 'odoo:x:1:1:::' >> /newroot/etc/passwd \
&& echo 'odoo:x:1:' >> /newroot/etc/group \
&& chown -R 1:1 /newroot/opt/odoo/ \
&& chmod 555 /newroot/entrypoint.sh \
&& mkdir /newroot/tmp \
&& chmod 1777 /newroot/tmp
# Final image.
FROM scratch
COPY --from=build /newroot /
# Mount /opt/odoo/data to allow restoring filestore.
VOLUME ["/opt/odoo/data/"]
# Expose Odoo services.
EXPOSE 8069
# Set default user when running the container.
USER odoo
# Start
ENTRYPOINT ["/entrypoint.sh"]
CMD ["odoo"]
# Metadata
LABEL org.label-schema.schema-version="16.0" \
org.label-schema.vendor=LeFilament \
org.label-schema.license=Apache-2.0 \
org.label-schema.vcs-url="https://sources.le-filament.com/lefilament/odoo_docker"
#!/bin/sh
# set the postgres database host, port, user and password according to the environment
# and pass them as arguments to the odoo process if not present in the config file
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
check_config() {
param="$1"
value="$2"
if ! grep -q -E "^\s*\b${param}\b\s*=" /opt/odoo/etc/odoo.conf ; then
DB_ARGS="${DB_ARGS} --${param} ${value}"
fi;
}
unaccent_db() {
/usr/bin/python3 -c "import psycopg2
try:
conn = psycopg2.connect(database='postgres', user='${USER}', password='${PASSWORD}', host='${HOST}', port='${PORT}')
except:
print('err: init: fail to connect to database')
exit(11)
cur = conn.cursor()
try:
cur.execute(\"SELECT datname FROM pg_database WHERE datname='${PGDATABASE}'\")
except:
print('err: init: fail to execute request')
cur.close()
conn.close()
exit(12)
if not cur.fetchall():
cur.close()
conn.close()
exit(1)
try:
cur.execute('CREATE EXTENSION IF NOT EXISTS unaccent')
except:
print('err: init: fail to execute request')
cur.close()
conn.close()
exit(13)
conn.commit()
cur.close()
conn.close()
exit(0)"
return $?
}
DB_ARGS=''
check_config "db_host" "$HOST"
check_config "db_port" "$PORT"
check_config "db_user" "$USER"
check_config "db_password" "$PASSWORD"
unaccent_db
return_code=$?
[ "$return_code" -gt 10 ] && exit 1
if [ "$return_code" == 1 ]; then
echo "info: init: database $PGDATABASE does not exist"
DB_ARGS="${DB_ARGS} --load-language fr_FR"
fi
case "$1" in
-- | odoo)
shift
if [[ "$1" == "scaffold" ]] ; then
exec /opt/odoo/odoo/odoo-bin -c /opt/odoo/etc/odoo.conf "$@"
else
exec /opt/odoo/odoo/odoo-bin -c /opt/odoo/etc/odoo.conf "$@" ${DB_ARGS}
fi
;;
-*)
exec /opt/odoo/odoo/odoo-bin -c /opt/odoo/etc/odoo.conf "$@" ${DB_ARGS}
;;
*)
exec "$@"
esac
exit 1
Ce diff est replié.
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter