Skip to content
Snippets Groups Projects
Commit 8c4c4394 authored by Christophe Monniez's avatar Christophe Monniez
Browse files

[REF] packaging: use docker to build packages


Actually, docker is used to test Linux packages once they are built.
The packaging process is done on the host system where package.py is
run.

Consequences:
    * difficult to reproduce an exact same build on another host
    * changing a Debian/Ubuntu target version means some upgrade steps
      on the build host (mix that with the fact that the host also
      could build old Odoo versions)
    * Fedora rpm package is built on an Ubuntu system (which is not a
      real problem but it could be)

With this commit, the package.py utility is refactored to use Docker
containers to build the Gnu/Linux packages.

Also, the Debian package is adapted for Debian Buster, the RPM package
is built based on Fedora 30.

Some minor changes are also made in the windows packaging system.

closes odoo/odoo#37766

Signed-off-by: default avatarChristophe Monniez (moc) <moc@odoo.com>
parent e10a4025
No related branches found
No related tags found
No related merge requests found
[install]
optimize=1
[bdist_rpm]
no-autoreq = yes
install-script = setup/redhat/install.sh
......@@ -48,3 +51,4 @@ requires =
python3-werkzeug
python3-xlwt
python3-xlrd
# Please note that this Dockerfile is used for testing nightly builds and should
# not be used to deploy Odoo
FROM debian:stretch
FROM debian:buster
MAINTAINER Odoo S.A. <info@odoo.com>
RUN apt-get update && \
......@@ -12,11 +12,14 @@ RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8
ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -qq && \
apt-get upgrade -qq -y && \
apt-get install -qq -y\
adduser \
dh-python \
packaging-dev \
postgresql \
postgresql-client \
python3 \
......@@ -51,7 +54,8 @@ RUN apt-get update -qq && \
python3-vatnumber \
python3-vobject \
python3-werkzeug \
python3-xlsxwriter && \
python3-xlsxwriter \
rsync && \
rm -rf /var/lib/apt/lists/*
RUN echo "PS1=\"[\u@nightly-tests] # \"" > ~/.bashrc
# Please note that this Dockerfile is used for testing nightly builds and should
# not be used to deploy Odoo
FROM fedora:26
FROM fedora:30
MAINTAINER Odoo S.A. <info@odoo.com>
# Dependencies and postgres
......@@ -45,17 +45,17 @@ RUN dnf update -d 0 -e 0 -y && \
python3-werkzeug \
python3-xlwt \
python3-xlrd \
python3-xlsxwriter \
libsass \
pytz \
postgresql \
postgresql-server \
postgresql-libs \
postgresql-contrib \
postgresql-devel -y && \
postgresql-devel \
rpmdevtools -y && \
dnf clean all
RUN pip3 install XlsxWriter
# Postgres configuration
RUN mkdir -p /var/lib/postgres/data
RUN chown -R postgres:postgres /var/lib/postgres/data
......
# Please note that this Dockerfile is used for testing nightly builds and should
# not be used to deploy Odoo
FROM debian:stretch
FROM debian:buster
MAINTAINER Odoo S.A. <info@odoo.com>
RUN apt-get update && \
......@@ -20,7 +20,7 @@ RUN apt-get update -qq && \
postgresql-server-dev-all \
postgresql-client \
adduser \
libsass0 \
libsass1 \
libxml2-dev \
libxslt1-dev \
libldap2-dev \
......
This diff is collapsed.
#!/bin/sh
set -e
python3 setup.py install --prefix=/usr --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --install-lib usr/lib/python3.6/site-packages/
python3 setup.py install --prefix=/usr --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES --install-lib usr/lib/python3.7/site-packages/
......@@ -10,12 +10,6 @@ ODOO_LOG_DIR=/var/log/odoo
ODOO_LOG_FILE=$ODOO_LOG_DIR/odoo-server.log
ODOO_USER="odoo"
if [ -d /usr/lib/python3.7 ]; then
SITE_PACK_DIR37=/usr/lib/python3.7/site-packages
[[ ! -d ${SITE_PACK_DIR37} ]] && mkdir -p ${SITE_PACK_DIR37}
ln -s /usr/lib/python3.6/site-packages/odoo ${SITE_PACK_DIR37}/odoo
fi
if ! getent passwd | grep -q "^odoo:"; then
groupadd $ODOO_GROUP
adduser --system --no-create-home $ODOO_USER -g $ODOO_GROUP
......@@ -34,7 +28,7 @@ db_host = False
db_port = False
db_user = $ODOO_USER
db_password = False
addons_path = /usr/lib/python3.6/site-packages/odoo/addons
addons_path = /usr/lib/python3.7/site-packages/odoo/addons
" > $ODOO_CONFIGURATION_FILE
chown $ODOO_USER:$ODOO_GROUP $ODOO_CONFIGURATION_FILE
chmod 0640 $ODOO_CONFIGURATION_FILE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment