Skip to content
Extraits de code Groupes Projets
Valider a3dd2d07 rédigé par Théo - Le Filament's avatar Théo - Le Filament
Parcourir les fichiers

feat(build): script to retrieve addons and save commit hashes into multilingual image

parent 010dc6aa
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -80,48 +80,48 @@ COPY --chown=root:root --chmod=755 ./get_addons /usr/local/bin ...@@ -80,48 +80,48 @@ COPY --chown=root:root --chmod=755 ./get_addons /usr/local/bin
# Install Odoo OCA default dependencies # Install Odoo OCA default dependencies
ARG SAVE_COMMITS_FILENAME='default_addons' ARG SAVE_COMMITS_FILENAME='default_addons'
RUN set -x; \ RUN set -x; \
get_addons 'https://github.com/OCA/account-financial-reporting.git' '12.0' 'additional_addons' \ get_addons 'https://github.com/OCA/account-financial-reporting' '12.0' 'additional_addons' \
account_tax_balance \ account_tax_balance \
&& get_addons 'https://github.com/OCA/account-financial-tools.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/account-financial-tools' '12.0' 'additional_addons' \
account_lock_date_update \ account_lock_date_update \
&& get_addons 'https://github.com/OCA/account-invoicing.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/account-invoicing' '12.0' 'additional_addons' \
sale_timesheet_invoice_description \ sale_timesheet_invoice_description \
&& get_addons 'https://github.com/OCA/bank-statement-import.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/bank-statement-import' '12.0' 'additional_addons' \
account_bank_statement_import_ofx \ account_bank_statement_import_ofx \
&& get_addons 'https://github.com/OCA/knowledge.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/knowledge' '12.0' 'additional_addons' \
knowledge \ knowledge \
document_page \ document_page \
&& get_addons 'https://github.com/OCA/partner-contact.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/partner-contact' '12.0' 'additional_addons' \
partner_disable_gravatar \ partner_disable_gravatar \
partner_firstname \ partner_firstname \
&& get_addons 'https://github.com/OCA/project.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/project' '12.0' 'additional_addons' \
project_category \ project_category \
project_status \ project_status \
project_task_default_stage \ project_task_default_stage \
project_template \ project_template \
project_timeline \ project_timeline \
&& get_addons 'https://github.com/OCA/sale-workflow.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/sale-workflow' '12.0' 'additional_addons' \
partner_contact_sale_info_propagation \ partner_contact_sale_info_propagation \
partner_prospect \ partner_prospect \
&& get_addons 'https://github.com/OCA/server-auth.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/server-auth' '12.0' 'additional_addons' \
auth_session_timeout \ auth_session_timeout \
password_security \ password_security \
&& get_addons 'https://github.com/OCA/server-brand.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/server-brand' '12.0' 'additional_addons' \
disable_odoo_online \ disable_odoo_online \
remove_odoo_enterprise \ remove_odoo_enterprise \
&& get_addons 'https://github.com/OCA/server-tools.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/server-tools' '12.0' 'additional_addons' \
base_search_fuzzy \ base_search_fuzzy \
module_change_auto_install \ module_change_auto_install \
&& get_addons 'https://github.com/OCA/server-ux.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/server-ux' '12.0' 'additional_addons' \
base_technical_features \ base_technical_features \
date_range \ date_range \
mass_editing \ mass_editing \
mass_operation_abstract \ mass_operation_abstract \
&& get_addons 'https://github.com/OCA/social.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/social' '12.0' 'additional_addons' \
base_search_mail_content \ base_search_mail_content \
mail_debrand \ mail_debrand \
mail_tracking \ mail_tracking \
&& get_addons 'https://github.com/OCA/web.git' '12.0' 'additional_addons' \ && get_addons 'https://github.com/OCA/web' '12.0' 'additional_addons' \
web_environment_ribbon \ web_environment_ribbon \
web_export_view \ web_export_view \
web_no_bubble \ web_no_bubble \
......
FROM debian:stretch-slim FROM debian/eol:stretch-slim
MAINTAINER Le Filament <https://le-filament.com> MAINTAINER Le Filament <https://le-filament.com>
ENV APT_DEPS='build-essential libldap2-dev libsasl2-dev python3-dev python3-wheel' \ ENV APT_DEPS='build-essential libldap2-dev libsasl2-dev python3-dev python3-wheel' \
...@@ -7,8 +7,12 @@ ENV APT_DEPS='build-essential libldap2-dev libsasl2-dev python3-dev python3-whee ...@@ -7,8 +7,12 @@ ENV APT_DEPS='build-essential libldap2-dev libsasl2-dev python3-dev python3-whee
PGDATABASE=odoo PGDATABASE=odoo
RUN set -x; \ RUN set -x; \
apt-get update &&\ sed -E -i \
apt-get install -y --no-install-recommends \ -e 's/deb.debian.org/archive.debian.org/g' \
-e 's!(^deb http://archive.debian.org/debian stretch-updates main$)!#\1!' \
/etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \ apt-transport-https \
ca-certificates \ ca-certificates \
curl \ curl \
...@@ -32,104 +36,110 @@ RUN set -x; \ ...@@ -32,104 +36,110 @@ RUN set -x; \
xfonts-75dpi \ xfonts-75dpi \
xfonts-base \ xfonts-base \
xz-utils \ xz-utils \
&&\ && echo 'deb http://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list \
echo 'deb http://apt-archive.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/postgresql.list &&\ && curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
curl -SL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - &&\ && curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb \
curl -o wkhtmltox.deb -SL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb &&\ && echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - \
echo '7e35a63f9db14f93ec7feeb0fce76b30c08f2057 wkhtmltox.deb' | sha1sum -c - &&\ && apt-get update \
apt-get update &&\ && apt-get install -y --no-install-recommends ./wkhtmltox.deb \
apt-get install -y --no-install-recommends ./wkhtmltox.deb &&\ && apt-get install -y --no-install-recommends postgresql-client \
apt-get install -y --no-install-recommends postgresql-client &&\ && apt-get install -y --no-install-recommends ${APT_DEPS} \
apt-get install -y --no-install-recommends ${APT_DEPS} &&\ && curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3 /dev/stdin \
curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3 /dev/stdin &&\ && pip install -I -r https://raw.githubusercontent.com/OCA/OCB/12.0/requirements.txt \
pip install -I -r https://raw.githubusercontent.com/OCA/OCB/12.0/requirements.txt &&\ && pip install 'simplejson' 'WTForms' 'zxcvbn' 'phonenumbers' 'Werkzeug==0.14.1' \
pip install simplejson WTForms zxcvbn phonenumbers Werkzeug==0.14.1 &&\ && apt-get -y purge ${APT_DEPS} \
apt-get -y purge ${APT_DEPS} &&\ && apt-get -y autoremove \
apt-get -y autoremove &&\ && rm -rf /var/lib/apt/lists/* wkhtmltox.deb
rm -rf /var/lib/apt/lists/* wkhtmltox.deb
ARG SAVE_COMMITS_DIR='/opt/odoo_commits/'
ENV SAVE_COMMITS_DIR=$SAVE_COMMITS_DIR
# Add Git Known Hosts # Add Git Known Hosts
COPY ./ssh_known_git_hosts /root/.ssh/known_hosts COPY ./ssh_known_git_hosts /root/.ssh/known_hosts
# Install Odoo and remove .git directory to limit amount of data used by container # Install Odoo and remove .git directory to limit amount of data used by container
ARG SAVE_COMMITS_FILENAME='ocb'
RUN set -x; \ RUN set -x; \
useradd -l --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}" &&\
# RC get fix for export (until https://github.com/OCA/OCB/pull/1141 is merged) # RC get fix for export (until https://github.com/OCA/OCB/pull/1141 is merged)
#git clone -b 12.0 --depth 1 https://github.com/OCA/OCB.git /opt/odoo/odoo &&\ # repo='https://github.com/OCA/OCB' \
git clone -b 12.0-imp_export_of_m2m --depth 1 https://github.com/lefilament/odoo.git /opt/odoo/odoo &&\ # branch='12.0' \
rm -rf /opt/odoo/odoo/.git &&\ repo='https://github.com/lefilament/odoo' \
chown -R odoo:odoo /opt/odoo branch='12.0-imp_export_of_m2m' \
&& 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}" \
&& mkdir /opt/odoo_commits \
&& git clone --single-branch --branch "${branch}" --depth 1 "${repo}" /tmp/repo \
&& commit="$(git -C /tmp/repo rev-parse HEAD)" \
&& mv /tmp/repo/* /opt/odoo/odoo/ \
&& echo "${repo};${commit}" > $SAVE_COMMITS_DIR/$SAVE_COMMITS_FILENAME \
&& rm -r /tmp/repo \
# Only keep French translations.
&& echo "info: OCB commit:" \
&& cat $SAVE_COMMITS_DIR/$SAVE_COMMITS_FILENAME
# Add script to download Odoo addons.
COPY --chown=root:root --chmod=755 ./get_addons /usr/local/bin
# Install Odoo OCA default dependencies # Install Odoo OCA default dependencies
ARG SAVE_COMMITS_FILENAME='default_addons'
RUN set -x; \ RUN set -x; \
mkdir -p /tmp/oca-repos/ &&\ get_addons 'https://github.com/OCA/account-financial-reporting' '12.0' 'additional_addons' \
git clone -b 12.0 --depth 1 https://github.com/OCA/account-financial-reporting.git /tmp/oca-repos/account-financial-reporting &&\ account_tax_balance \
mv /tmp/oca-repos/account-financial-reporting/account_tax_balance /opt/odoo/additional_addons/ &&\ && get_addons 'https://github.com/OCA/account-financial-tools' '12.0' 'additional_addons' \
git clone -b 12.0 --depth 1 https://github.com/OCA/account-financial-tools.git /tmp/oca-repos/account-financial-tools &&\ account_lock_date_update \
mv /tmp/oca-repos/account-financial-tools/account_lock_date_update \ && get_addons 'https://github.com/OCA/account-invoicing' '12.0' 'additional_addons' \
/opt/odoo/additional_addons/ &&\ sale_timesheet_invoice_description \
git clone -b 12.0 --depth 1 https://github.com/OCA/account-invoicing.git /tmp/oca-repos/account-invoicing &&\ && get_addons 'https://github.com/OCA/bank-statement-import' '12.0' 'additional_addons' \
mv /tmp/oca-repos/account-invoicing/sale_timesheet_invoice_description \ account_bank_statement_import_ofx \
/opt/odoo/additional_addons/ &&\ && get_addons 'https://github.com/OCA/knowledge' '12.0' 'additional_addons' \
git clone -b 12.0 --depth 1 https://github.com/OCA/bank-statement-import.git /tmp/oca-repos/bank-statement-import &&\ knowledge \
mv /tmp/oca-repos/bank-statement-import/account_bank_statement_import_ofx /opt/odoo/additional_addons/ &&\ document_page \
git clone -b 12.0 --depth 1 https://github.com/OCA/knowledge.git /tmp/oca-repos/knowledge &&\ && get_addons 'https://github.com/OCA/partner-contact' '12.0' 'additional_addons' \
mv /tmp/oca-repos/knowledge/knowledge /tmp/oca-repos/knowledge/document_page /opt/odoo/additional_addons/ &&\ partner_disable_gravatar \
git clone -b 12.0 --depth 1 https://github.com/OCA/partner-contact.git /tmp/oca-repos/partner-contact &&\ partner_firstname \
mv /tmp/oca-repos/partner-contact/partner_disable_gravatar \ && get_addons 'https://github.com/OCA/project' '12.0' 'additional_addons' \
/tmp/oca-repos/partner-contact/partner_firstname \ project_category \
/opt/odoo/additional_addons/ &&\ project_status \
git clone -b 12.0 --depth 1 https://github.com/OCA/project.git /tmp/oca-repos/project &&\ project_task_default_stage \
mv /tmp/oca-repos/project/project_category \ project_template \
/tmp/oca-repos/project/project_status \ project_timeline \
/tmp/oca-repos/project/project_task_default_stage \ && get_addons 'https://github.com/OCA/sale-workflow' '12.0' 'additional_addons' \
/tmp/oca-repos/project/project_template \ partner_contact_sale_info_propagation \
/tmp/oca-repos/project/project_timeline \ partner_prospect \
/opt/odoo/additional_addons/ &&\ && get_addons 'https://github.com/OCA/server-auth' '12.0' 'additional_addons' \
git clone -b 12.0 --depth 1 https://github.com/OCA/sale-workflow.git /tmp/oca-repos/sale-workflow &&\ auth_session_timeout \
mv /tmp/oca-repos/sale-workflow/partner_contact_sale_info_propagation \ password_security \
/tmp/oca-repos/sale-workflow/partner_prospect \ && get_addons 'https://github.com/OCA/server-brand' '12.0' 'additional_addons' \
/opt/odoo/additional_addons/ &&\ disable_odoo_online \
git clone -b 12.0 --depth 1 https://github.com/OCA/server-auth.git /tmp/oca-repos/server-auth &&\ remove_odoo_enterprise \
mv /tmp/oca-repos/server-auth/auth_session_timeout \ && get_addons 'https://github.com/OCA/server-tools' '12.0' 'additional_addons' \
/tmp/oca-repos/server-auth/password_security \ base_search_fuzzy \
/opt/odoo/additional_addons/ &&\ module_change_auto_install \
git clone -b 12.0 --depth 1 https://github.com/OCA/server-brand.git /tmp/oca-repos/server-brand &&\ && get_addons 'https://github.com/OCA/server-ux' '12.0' 'additional_addons' \
mv /tmp/oca-repos/server-brand/disable_odoo_online \ base_technical_features \
/tmp/oca-repos/server-brand/remove_odoo_enterprise \ date_range \
/opt/odoo/additional_addons/ &&\ mass_editing \
git clone -b 12.0 --depth 1 https://github.com/OCA/server-tools.git /tmp/oca-repos/server-tools &&\ mass_operation_abstract \
mv /tmp/oca-repos/server-tools/base_search_fuzzy \ && get_addons 'https://github.com/OCA/social' '12.0' 'additional_addons' \
/tmp/oca-repos/server-tools/module_change_auto_install \ base_search_mail_content \
/opt/odoo/additional_addons/ &&\ mail_debrand \
git clone -b 12.0 --depth 1 https://github.com/OCA/server-ux.git /tmp/oca-repos/server-ux &&\ mail_tracking \
mv /tmp/oca-repos/server-ux/base_technical_features \ && get_addons 'https://github.com/OCA/web' '12.0' 'additional_addons' \
/tmp/oca-repos/server-ux/date_range \ web_environment_ribbon \
/tmp/oca-repos/server-ux/mass_editing \ web_export_view \
/tmp/oca-repos/server-ux/mass_operation_abstract \ web_no_bubble \
/opt/odoo/additional_addons/ &&\ web_responsive \
git clone -b 12.0 --depth 1 https://github.com/OCA/social.git /tmp/oca-repos/social &&\ web_timeline \
mv /tmp/oca-repos/social/base_search_mail_content \ # Only keep French translations.
/tmp/oca-repos/social/mail_debrand \ # Install Le Filament default addons.
/tmp/oca-repos/social/mail_tracking \ && get_addons 'https://sources.le-filament.com/lefilament/lefilament_release_agent.git' '12.0' 'private_addons/lefilament_release_agent' \
/opt/odoo/additional_addons/ &&\ && echo "info: default addon commits:" \
git clone -b 12.0 --depth 1 https://github.com/OCA/web.git /tmp/oca-repos/web &&\ && cat $SAVE_COMMITS_DIR/$SAVE_COMMITS_FILENAME
mv /tmp/oca-repos/web/web_environment_ribbon \
/tmp/oca-repos/web/web_export_view \
/tmp/oca-repos/web/web_no_bubble \
/tmp/oca-repos/web/web_responsive \
/tmp/oca-repos/web/web_timeline \
/opt/odoo/additional_addons/ &&\
rm -rf /tmp/oca-repos/ &&\
# Install Le Filament default dependency
git clone -b 12.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 # Copy entrypoint script and Odoo configuration file
COPY ./entrypoint.sh / COPY ./entrypoint.sh /
COPY ./odoo.conf /opt/odoo/etc/odoo.conf COPY ./odoo.conf /opt/odoo/etc/odoo.conf
RUN chown odoo:odoo /opt/odoo/etc/odoo.conf RUN chown -R odoo:odoo /opt/odoo
# Mount /opt/odoo/data to allow restoring filestore # Mount /opt/odoo/data to allow restoring filestore
VOLUME ["/opt/odoo/data/"] VOLUME ["/opt/odoo/data/"]
......
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