Skip to content

Commit

Permalink
feat: add odoo 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vrenaville committed Nov 2, 2023
1 parent ab17d1a commit b10c002
Show file tree
Hide file tree
Showing 11 changed files with 280 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
odoo_serie: ["11.0", "12.0", "13.0", "14.0", "14.0-bullseye", "15.0", "16.0"]
odoo_serie: ["11.0", "12.0", "13.0", "14.0", "14.0-bullseye", "15.0", "16.0", "17.0"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -56,7 +56,8 @@ jobs:
context: ./build
push: false
load: true
tags: ${{ matrix.odoo_serie }}:latest
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
83 changes: 83 additions & 0 deletions 17.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
FROM python:3.10-bullseye
MAINTAINER Camptocamp
ARG UID=999
# create the working directory and a place to set the logs (if wanted)
RUN mkdir -p /odoo /var/log/odoo

COPY ./base_requirements.txt /odoo
COPY ./install /install

# Moved because there was a bug while installing `odoo-autodiscover`. There is
# an accent in the contributor name
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8

# build and dev packages
ENV BUILD_PACKAGE \
build-essential \
gcc \
libevent-dev \
libfreetype6-dev \
libxml2-dev \
libxslt1-dev \
libsasl2-dev \
libldap2-dev \
libssl-dev \
libjpeg-dev \
libpng-dev \
zlib1g-dev \
git

# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf
# wkhtml-buster is kept as in official image, no deb available for bullseye
RUN set -x; \
sh -c /install/package_odoo-bullseye.sh \
&& /install/setup-pip.sh \
&& /install/postgres.sh \
&& /install/kwkhtml_client.sh \
&& /install/kwkhtml_client_force_python3.sh \
&& /install/dev_package.sh \
&& python3 -m pip install --force-reinstall pip "setuptools<58" \
&& pip install -r /odoo/base_requirements.txt --ignore-installed \
&& /install/purge_dev_package_and_cache.sh

# grab dockerize to generate template and
# wait on postgres
RUN /install/dockerize.sh

COPY ./src_requirements.txt /odoo
COPY ./bin /odoo/odoo-bin
COPY ./templates /templates
COPY ./before-migrate-entrypoint.d /odoo/before-migrate-entrypoint.d
COPY ./start-entrypoint.d /odoo/start-entrypoint.d
COPY ./MANIFEST.in /odoo
RUN adduser --disabled-password -u $UID --gecos '' odoo \
&& touch /odoo/odoo.cfg \
&& mkdir -p /odoo/data/odoo/{addons,filestore,sessions} \
&& chown -R odoo:odoo /odoo && usermod odoo --home /odoo \
&& chown -R odoo:odoo /var/log/odoo

VOLUME ["/data/odoo", "/var/log/odoo"]
USER odoo
# Expose Odoo services
EXPOSE 8069 8072

ENV ODOO_VERSION=17.0 \
PATH=/odoo/odoo-bin:/odoo/.local/bin:$PATH \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
DB_HOST=db \
DB_PORT=5432 \
DB_NAME=odoodb \
DB_USER=odoo \
DB_PASSWORD=odoo \
ODOO_BASE_URL=http://localhost:8069 \
ODOO_REPORT_URL=http://localhost:8069 \
# the place where you put the data of your project (csv, ...)
ODOO_DATA_PATH=/odoo/data \
DEMO=False \
ADDONS_PATH=/odoo/local-src,/odoo/src/addons \
OPENERP_SERVER=/odoo/odoo.cfg

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["odoo"]
1 change: 1 addition & 0 deletions 17.0/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include odoo/data *
85 changes: 85 additions & 0 deletions 17.0/base_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Odoo dependencies
Babel==2.11.0
chardet==5.0.0
decorator==5.1.1
docutils==0.19
ebaysdk==2.2.0
freezegun==1.2.2
gevent==22.10.2
greenlet==2.0.1
html2text==2020.1.16
idna==3.4
Jinja2==3.1.2
libsass==0.21.0
lxml==4.9.1
Mako==1.2.3
MarkupSafe==2.1.1
num2words==0.5.12
ofxparse==0.21
passlib==1.7.4
Pillow==9.3.0
polib==1.1.1
psutil==5.9.4
psycopg2==2.9.5
pydot==1.4.2
python-ldap==3.4.3
PyPDF2==1.27.12
pyserial==3.5
python-dateutil==2.8.2
pytz==2022.6
pyusb==1.2.1
qrcode==7.3.1
reportlab==3.6.12
requests==2.28.1
zeep==4.2.0
python-stdnum==1.17
vobject==0.9.6.1
Werkzeug==0.16.1
XlsxWriter==3.0.3
xlwt==1.3.0
xlrd==2.0.1
pyOpenSSL==22.1.0

setuptools<58

# Not part of official requirements, but used by some addons
# colorama==0.3.9
gdata==2.0.18
html5lib==1.1
odfpy==1.4.1
pyinotify==0.9.6
simplejson==3.17.6
urllib3==1.26.7

# Migration tools
marabunta==0.10.6
-e git+https://github.com/camptocamp/anthem@master#egg=anthem

# test / lint
# those libs and their dependencies are unpinned
# to always test with the last version of it
flake8
pytest>=5.4.2
pluggy
coverage
pytest-odoo>=0.4.7
pytest-cov>=2.10.0
watchdog

# Library dependency
argh==0.26.2
atomicwrites==1.4.1
attrs==22.1.0
beautifulsoup4==4.11.1
future==0.18.2
mccabe==0.7.0
more-itertools==9.0.0
pathtools==0.1.2
pbr==5.11.0
pexpect==4.8.0
ptyprocess==0.7.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
unicodecsv==0.14.1
wrapt==1.14.1
45 changes: 45 additions & 0 deletions 17.0/extra_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Extra python dependencies
algoliasearch==2.6.2
Adyen==7.1.1
cachetools==5.2.0
cerberus==1.3.4
boto3==1.26.7
factur-x==2.3
invoice2data==0.3.6
mailjet-rest==1.3.4
openupgradelib==3.3.4
paramiko==2.12.0
parse-accept-language==0.1.2
paypalrestsdk==1.13.1
phonenumbers==8.13.0
pyquerystring==1.1
pyOpenSSL==22.1.0
pyquerystring==1.1
pysimplesoap==1.16.2
requests-mock==1.10.0
slugify==0.0.1
stripe==4.2.0
unidecode==1.3.6
vcrpy==4.2.1

# Library dependency
asn1crypto==1.5.1
bcrypt==4.0.1
botocore==1.29.7
cffi==1.15.1
cryptography==38.0.3
dateparser==1.1.3
idna==3.4
jmespath==1.0.1
multidict==6.0.2
pdfminer.six==20221105
pyasn1==0.4.8
pycparser==2.21
pycryptodome==3.15.0
PyNaCl==1.5.0
pytesseract==0.3.10
regex==2022.10.31
s3transfer==0.6.0
tzlocal==4.2
Unidecode==1.3.6
yarl==1.8.1
8 changes: 8 additions & 0 deletions 17.0/src_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Requirements for the project itself and for Odoo.
# When we install Odoo with -e, odoo.py is available in the PATH and
# 'openerp' in the PYTHONPATH
#
# They are installed only after all the project's files have been copied
# into the image (with ONBUILD)
-e .
-e src
51 changes: 51 additions & 0 deletions 17.0/templates/odoo.cfg.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[options]
addons_path = {{ .Env.ADDONS_PATH }}
data_dir = /odoo/data/odoo
auto_reload = False
db_host = {{ .Env.DB_HOST }}
db_name = {{ .Env.DB_NAME }}
db_user = {{ .Env.DB_USER }}
db_password = {{ .Env.DB_PASSWORD }}
db_sslmode = {{ default .Env.DB_SSLMODE "prefer" }}
dbfilter = ^{{ default .Env.DB_FILTER .Env.DB_NAME }}$
list_db = {{ default .Env.LIST_DB "False" }}
admin_passwd = {{ default .Env.ADMIN_PASSWD "" }}
db_maxconn = {{ default .Env.DB_MAXCONN "64" }}
limit_memory_soft = {{ default .Env.LIMIT_MEMORY_SOFT "2147483648" }}
limit_memory_hard = {{ default .Env.LIMIT_MEMORY_HARD "2684354560" }}
limit_request = {{ default .Env.LIMIT_REQUEST "8192" }}
limit_time_cpu = {{ default .Env.LIMIT_TIME_CPU "60" }}
limit_time_real = {{ default .Env.LIMIT_TIME_REAL "120" }}
limit_time_real_cron = {{ default .Env.LIMIT_TIME_REAL_CRON "120" }}
log_handler = {{ default .Env.LOG_HANDLER "':INFO'" }}
log_level = {{ default .Env.LOG_LEVEL "info" }}
max_cron_threads = {{ default .Env.MAX_CRON_THREADS "2" }}
workers = {{ default .Env.WORKERS "4" }}
logfile = {{ default .Env.LOGFILE "None" }}
log_db = {{ default .Env.LOG_DB "False" }}
logrotate = True
syslog = {{ default .Env.SYSLOG "False" }}
running_env = {{ default .Env.RUNNING_ENV "dev" }}
without_demo = {{ default .Env.WITHOUT_DEMO "True" }}
server_wide_modules = {{ default .Env.SERVER_WIDE_MODULES "" }}
; db_sslmode =
; We can activate proxy_mode even if we are not behind a proxy, because
; it is used only if HTTP_X_FORWARDED_HOST is set in environ
proxy_mode = True
; csv_internal_sep = ,
; db_template = template1
; debug_mode = False
; email_from = False
; http_port = 8069
; http_enable = True
; http_interface =
; longpolling_port = 8072
; osv_memory_age_limit = 1.0
; osv_memory_count_limit = False
; smtp_password = False
; smtp_port = 25
; smtp_server = localhost
; smtp_ssl = False
; smtp_user = False
unaccent = {{ default .Env.UNACCENT "False" }}
{{ default .Env.ADDITIONAL_ODOO_RC "" }}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $(error VERSION is not set)
endif

ifeq ($(TARGET), GHCR)
NAME=ghcr.io/camptocamp/odoo-project
NAME=ghcr.io/camptocamp/docker-odoo-project
else
NAME=camptocamp/odoo-project
endif
Expand Down
2 changes: 1 addition & 1 deletion bin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if [ ! -f "${CONFIG_TARGET}" ]; then
fi

# Wait until postgres is up
pg_isready
pg_isready -t 30

BASE_CMD=$(basename $1)
CMD_ARRAY=($*)
Expand Down
2 changes: 1 addition & 1 deletion bin/runmigration
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# steps on top of it.
set -e

pg_isready
pg_isready -t 30
CACHE_DIR=${CACHE_DIR:=/tmp/cachedb}

echo $CACHE_DIR
Expand Down
2 changes: 1 addition & 1 deletion bin/runtests
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set -e

# TODO: if we are not in TRAVIS, make a template then run tests on a copy

pg_isready
pg_isready -t 30

LOCAL_SRC_DIR=/odoo/local-src
CACHE_DIR=${CACHE_DIR:=/tmp/cachedb}
Expand Down

0 comments on commit b10c002

Please sign in to comment.