From 98b74c73471f6aae9ef4870b604caa0e2768bd5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com> Date: Mon, 2 Aug 2021 09:42:54 +0200 Subject: [PATCH] Create branch for version 12.0 --- .dockerignore | 3 -- .gitlab-ci.yml | 39 ++++++++++++--- .travis.yml | 33 ------------- 10.0.Dockerfile | 129 ------------------------------------------------ 14.0.Dockerfile | 126 ---------------------------------------------- README.md | 33 +++++++++---- hooks/build | 20 -------- hooks/post_push | 14 ------ 8 files changed, 55 insertions(+), 342 deletions(-) delete mode 100644 .dockerignore delete mode 100644 .travis.yml delete mode 100644 10.0.Dockerfile delete mode 100644 14.0.Dockerfile delete mode 100644 hooks/build delete mode 100644 hooks/post_push diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index bf9a8cd..0000000 --- a/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -.git* -LICENSE -README* diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6948bc4..88a5ad4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +1,47 @@ -image: docker:latest +image: docker:20.10.7 -docker-build-master: +docker-build-10.0: # Official docker image. - image: docker:19.03.12 + image: docker:20.10.7 stage: build services: - - docker:19.03.12-dind + - docker:20.10.7-dind + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build --pull -f 10.0.Dockerfile -t "$CI_REGISTRY_IMAGE:10.0" . + - docker push "$CI_REGISTRY_IMAGE:10.0" + only: + - 10.0 + +docker-build-12.0: + # Official docker image. + image: docker:20.10.7 + stage: build + services: + - docker:20.10.7-dind before_script: - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build --pull -f 12.0.Dockerfile -t "$CI_REGISTRY_IMAGE:12.0" . - docker build --pull -f 12.0_ml.Dockerfile -t "$CI_REGISTRY_IMAGE:12.0_ml" . - docker build --pull -f 12.0_py3.6.Dockerfile -t "$CI_REGISTRY_IMAGE:12.0_py3.6" . - - docker build --pull -f 14.0.Dockerfile -t "$CI_REGISTRY_IMAGE:14.0" . - docker push "$CI_REGISTRY_IMAGE:12.0" - docker push "$CI_REGISTRY_IMAGE:12.0_ml" - docker push "$CI_REGISTRY_IMAGE:12.0_py3.6" - - docker push "$CI_REGISTRY_IMAGE:14.0" only: - - master + - 12.0 +docker-build-14.0: + # Official docker image. + image: docker:20.10.7 + stage: build + services: + - docker:20.10.7-dind + before_script: + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY + script: + - docker build --pull -f 14.0.Dockerfile -t "$CI_REGISTRY_IMAGE:14.0" . + - docker push "$CI_REGISTRY_IMAGE:14.0" + only: + - 14.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 566066e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -sudo: required - -language: python - -python: - - "3.6" - -services: - - docker - -git: - depth: 1 - -branches: - only: - - master - -env: - global: - # Variables found by default in Docker Hub builder - - DOCKER_REPO=remifilament/odoo - matrix: - - DOCKER_TAG=10.0 - -before_install: - - sudo apt-get update - - sudo apt-get -y -o Dpkg::Options::=--force-confnew install docker-ce - - pip install -r requirements-ci.txt - -install: - - chown -R $USER:$USER . - - chmod -R +r . - - ./hooks/build diff --git a/10.0.Dockerfile b/10.0.Dockerfile deleted file mode 100644 index 7c1c8a9..0000000 --- a/10.0.Dockerfile +++ /dev/null @@ -1,129 +0,0 @@ -FROM debian:jessie -MAINTAINER Le Filament <https://le-filament.com> - -ENV APT_DEPS='python-dev build-essential libxml2-dev libxslt1-dev libjpeg-dev libfreetype6-dev \ - liblcms2-dev libopenjpeg-dev libtiff5-dev tk-dev tcl-dev linux-headers-amd64 \ - libpq-dev libldap2-dev libsasl2-dev' \ - LANG=C.UTF-8 \ - LC_ALL=C.UTF-8 \ - PGDATABASE=odoo - -RUN set -x; \ - sed -Ei 's@(^deb http://deb.debian.org/debian jessie-updates main$)@#\1@' /etc/apt/sources.list &&\ - apt-get update &&\ - apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - fontconfig \ - git \ - libjpeg62-turbo \ - libtiff5 \ - libx11-6 \ - libxcb1 \ - libxext6 \ - libxml2 \ - libxrender1 \ - libxslt1.1 \ - node-less \ - openssh-client \ - python-gevent \ - python-ldap \ - python-qrcode \ - python-renderpm \ - python-support \ - python-vobject \ - python-watchdog \ - sudo \ - xfonts-75dpi \ - xfonts-base \ - && \ - echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' >> /etc/apt/sources.list.d/postgresql.list &&\ - 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.jessie_amd64.deb &&\ - echo '4d104ff338dc2d2083457b3b1e9baab8ddf14202 wkhtmltox.deb' | sha1sum -c - &&\ - apt-get update &&\ - dpkg --install wkhtmltox.deb &&\ - apt-get install -y --no-install-recommends postgresql-client &&\ - apt-get install -y --no-install-recommends ${APT_DEPS} &&\ - curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python /dev/stdin &&\ - pip install -I -r https://raw.githubusercontent.com/OCA/OCB/10.0/requirements.txt &&\ - pip install simplejson WTForms Werkzeug==0.14.1 &&\ - apt-get -y purge ${APT_DEPS} &&\ - apt-get -y autoremove &&\ - rm -rf /var/lib/apt/lists/* wkhtmltox.deb - -# Add Git Known Hosts -COPY ./ssh_known_git_hosts /root/.ssh/known_hosts - -# Install Odoo and remove not French translations and .git directory to limit amount of data used by container -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}" &&\ - git clone -b 10.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 - -# Install Odoo OCA default dependencies -RUN set -x; \ - mkdir -p /tmp/oca-repos/ &&\ - git clone -b 10.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 10.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_bank_statement_import_ofx \ - /tmp/oca-repos/bank-statement-import/account_bank_statement_import_qif \ - /opt/odoo/additional_addons/ &&\ - git clone -b 10.0 --depth 1 https://github.com/OCA/knowledge.git /tmp/oca-repos/knowledge &&\ - mv /tmp/oca-repos/knowledge/knowledge /tmp/oca-repos/knowledge/document_page /opt/odoo/additional_addons/ &&\ - git clone -b 10.0 --depth 1 https://github.com/OCA/partner-contact.git /tmp/oca-repos/partner-contact &&\ - mv /tmp/oca-repos/partner-contact/partner_firstname \ - /tmp/oca-repos/partner-contact/partner_disable_gravatar \ - /opt/odoo/additional_addons/ &&\ - git clone -b 10.0 --depth 1 https://github.com/OCA/server-tools.git /tmp/oca-repos/server-tools &&\ - mv /tmp/oca-repos/server-tools/date_range \ - /tmp/oca-repos/server-tools/auth_session_timeout \ - /tmp/oca-repos/server-tools/auth_brute_force \ - /tmp/oca-repos/server-tools/password_security \ - /opt/odoo/additional_addons/ &&\ - git clone -b 10.0 --depth 1 https://github.com/OCA/social.git /tmp/oca-repos/social &&\ - mv /tmp/oca-repos/social/mail_debrand \ - /tmp/oca-repos/social/mail_restrict_follower_selection \ - /opt/odoo/additional_addons/ &&\ - git clone -b 10.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_export_view \ - /tmp/oca-repos/web/web_responsive \ - /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 &&\ - chown -R odoo:odoo /opt/odoo - -# Copy entrypoint script and Odoo configuration file -COPY ./entrypoint.sh / -COPY ./odoo.conf /opt/odoo/etc/odoo.conf -RUN chown odoo:odoo /opt/odoo/etc/odoo.conf - -# 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 -ARG VCS_REF -ARG BUILD_DATE -ARG VERSION -LABEL org.label-schema.schema-version="$VERSION" \ - org.label-schema.vendor=LeFilament \ - org.label-schema.license=Apache-2.0 \ - org.label-schema.build-date="$BUILD_DATE" \ - org.label-schema.vcs-ref="$VCS_REF" \ - org.label-schema.vcs-url="https://github.com/lefilament/docker-odoo" diff --git a/14.0.Dockerfile b/14.0.Dockerfile deleted file mode 100644 index 0f308b7..0000000 --- a/14.0.Dockerfile +++ /dev/null @@ -1,126 +0,0 @@ -FROM python:3.9-slim-buster -MAINTAINER Le Filament <https://le-filament.com> - -ENV APT_DEPS='build-essential libldap2-dev libpq-dev libsasl2-dev' \ - LANG=C.UTF-8 \ - LC_ALL=C.UTF-8 \ - PGDATABASE=odoo - -RUN set -x; \ - apt-get update &&\ - apt-get install -y --no-install-recommends \ - curl \ - git \ - gnupg \ - npm \ - openssh-client &&\ - echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' >> /etc/apt/sources.list.d/postgresql.list &&\ - 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.buster_amd64.deb &&\ - echo 'ea8277df4297afc507c61122f3c349af142f31e5 wkhtmltox.deb' | sha1sum -c - &&\ - apt-get update &&\ - 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 ${APT_DEPS} &&\ - pip3 install -r https://raw.githubusercontent.com/OCA/OCB/14.0/requirements.txt &&\ - pip3 install phonenumbers simplejson gevent==20.12.1 PyYAML zxcvbn &&\ - apt-get -y purge ${APT_DEPS} &&\ - apt-get -y autoremove &&\ - rm -rf /var/lib/apt/lists/* wkhtmltox.deb - -# Add Git Known Hosts -COPY ./ssh_known_git_hosts /root/.ssh/known_hosts - -# Install Odoo and remove not French translations and .git directory to limit amount of data used by container -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}" &&\ - git clone -b 14.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 - -# Install Odoo OCA default dependencies -RUN set -x; \ - mkdir -p /tmp/oca-repos/ &&\ - git clone -b 14.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 14.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 \ - /opt/odoo/additional_addons/ &&\ - # Comment out modules not yet migrated on OCA for v14 - #git clone -b 14.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 14.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 14.0 --depth 1 https://github.com/OCA/partner-contact.git /tmp/oca-repos/partner-contact &&\ - mv /tmp/oca-repos/partner-contact/partner_disable_gravatar \ - mv /tmp/oca-repos/partner-contact/partner_firstname \ - /opt/odoo/additional_addons/ &&\ - git clone -b 14.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 \ - /tmp/oca-repos/project/project_task_default_stage \ - /tmp/oca-repos/project/project_template \ - /tmp/oca-repos/project/project_timeline \ - /opt/odoo/additional_addons/ &&\ - git clone -b 14.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 14.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/portal_odoo_debranding \ - /tmp/oca-repos/server-brand/remove_odoo_enterprise \ - /opt/odoo/additional_addons/ &&\ - git clone -b 14.0 --depth 1 https://github.com/OCA/server-tools.git /tmp/oca-repos/server-tools &&\ - mv /tmp/oca-repos/server-tools/base_search_fuzzy \ - /opt/odoo/additional_addons/ &&\ - git clone -b 14.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 \ - /opt/odoo/additional_addons/ &&\ - git clone -b 14.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 \ - /opt/odoo/additional_addons/ &&\ - git clone -b 14.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_timeline \ - /opt/odoo/additional_addons/ &&\ - rm -rf /tmp/oca-repos/ &&\ - find /opt/odoo/additional_addons/*/i18n/ -type f -not -name 'fr.po' -delete &&\ - chown -R odoo:odoo /opt/odoo - -# Copy entrypoint script and Odoo configuration file -COPY ./entrypoint.sh / -COPY ./odoo.conf /opt/odoo/etc/odoo.conf -RUN chown odoo:odoo /opt/odoo/etc/odoo.conf - -# 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 -ARG VCS_REF -ARG BUILD_DATE -ARG VERSION -LABEL org.label-schema.schema-version="$VERSION" \ - org.label-schema.vendor=LeFilament \ - org.label-schema.license=Apache-2.0 \ - org.label-schema.build-date="$BUILD_DATE" \ - org.label-schema.vcs-ref="$VCS_REF" \ - org.label-schema.vcs-url="https://github.com/lefilament/docker-odoo" diff --git a/README.md b/README.md index 101e22e..cd05089 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ These docker images are now maintained on [Le Filament GitLab server](https://so This Docker is inspired from the ones from [Odoo](https://github.com/odoo/docker), [Tecnativa](https://github.com/Tecnativa/doodba) and [Elico Corporation](https://github.com/Elico-Corp/odoo-docker). -It creates a functional Odoo Docker of limited size (< 400 MB), including Odoo 10.0 or 12.0 from [OCA/OCB](https://github.com/oca/ocb), and also a few addons from [OCA](https://github.com/oca). +It creates a functional Odoo Docker of limited size (< 400 MB), including Odoo 10.0 or 12.0 or 14.0 from [OCA/OCB](https://github.com/oca/ocb), and also a few addons from [OCA](https://github.com/oca). In order to reduce as much as possible the size of the Docker, only French translations are kept and .git directories are removed. For people needing other languages than English or French, a 12.0_ml image is also provided. Also, some extra modules may need python 3.6 for Odoo v12 (python 3.5 by default on 12.0 image), therefore a specific 12.0_py3.6 has been created. -The following OCA addons are included by default in this image (in v14.0): +The following OCA addons are included by default in this image (in v12.0): ```yaml - repo: account-financial-reporting modules: @@ -20,13 +20,16 @@ The following OCA addons are included by default in this image (in v14.0): - repo: account-financial-tools modules: - account_lock_date_update - # Not yet approved PR on v14 - #- repo: account-invoicing - # modules: - # - sale_timesheet_invoice_description + - repo: account-invoicing + modules: + - sale_timesheet_invoice_description - repo: bank-statement-import modules: - account_bank_statement_import_ofx + - repo: knowledge + modules: + - document_page + - knowledge - repo: partner-contact modules: - partner_disable_gravatar @@ -38,19 +41,28 @@ The following OCA addons are included by default in this image (in v14.0): - project_task_default_stage - project_template - project_timeline + - repo: sale-workflow + modules: + - partner_contact_sale_info_propagation + - partner_prospect - repo: server-auth modules: + - auth_session_timeout - password_security - repo: server-brand modules: - disable_odoo_online - portal_odoo_debranding - remove_odoo_enterprise + - repo: server-tools + modules: + - base_search_fuzzy - repo: server-ux modules: - base_technical_features - date_range - mass_editing + - mass_operation_abstract - repo: social modules: - base_search_mail_content @@ -58,6 +70,7 @@ The following OCA addons are included by default in this image (in v14.0): - repo: web modules: - web_environment_ribbon + - web_export_view - web_responsive - web_timeline ``` @@ -83,8 +96,8 @@ docker-compose example is provided below: version: "2.1" services: odoo: - image: lefilament/odoo:14.0 - container_name: odoo14 + image: lefilament/odoo:12.0 + container_name: odoo12 depends_on: - db tty: true @@ -95,8 +108,8 @@ services: - odoo db: - image: postgres:13-alpine - container_name: odoo14_db + image: postgres:10-alpine + container_name: odoo12_db environment: POSTGRES_USER: "odoo" POSTGRES_PASSWORD: "odoo" diff --git a/hooks/build b/hooks/build deleted file mode 100644 index 2f7ec6b..0000000 --- a/hooks/build +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -ex - -# Get Odoo version -version="$DOCKER_TAG" -if [ "$version" == latest ]; then - version=14.0 -fi - -if [ -z "$IMAGE_NAME" ]; then - IMAGE_NAME="$DOCKER_REPO:$DOCKER_TAG" -fi - -time docker image build \ - --build-arg VCS_REF="$GIT_SHA1" \ - --build-arg BUILD_DATE="$(date --rfc-3339 ns)" \ - --build-arg ODOO_VERSION="$version" \ - --file "$version.Dockerfile" \ - --tag "$IMAGE_NAME" \ - . diff --git a/hooks/post_push b/hooks/post_push deleted file mode 100644 index ce05225..0000000 --- a/hooks/post_push +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -ex - -# Get Odoo version -version="$DOCKER_TAG" -if [ "$version" == latest ]; then - version=14.0 -fi - -if [ -z "$IMAGE_NAME" ]; then - IMAGE_NAME="$DOCKER_REPO:$DOCKER_TAG" -fi - -docker image push "$IMAGE_NAME" -- GitLab