Skip to content

Commit

Permalink
[ADD] Packaging: nightly tests: src dockerfile
Browse files Browse the repository at this point in the history
Creation of a Dockerfile for the src package for nightly tests.
Remove unnecessary libraries installation from the Debian Dockerfile.
  • Loading branch information
nim-odoo authored and aab-odoo committed Feb 20, 2015
1 parent aca6543 commit 520360d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 17 deletions.
16 changes: 1 addition & 15 deletions setup/package.dfdebian
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,9 @@ ENV LC_ALL C.UTF-8
RUN apt-get update -qq && \
apt-get upgrade -qq -y && \
apt-get install \
adduser \
postgresql \
postgresql-server-dev-all \
postgresql-client \
adduser \
libxml2-dev \
libxslt1-dev \
libldap2-dev \
libsasl2-dev \
libssl-dev \
libjpeg-dev \
python-dev \
python-pip \
build-essential \
python \
python-dateutil \
python-decorator \
Expand Down Expand Up @@ -65,8 +55,4 @@ RUN apt-get update -qq && \
python-yaml -y && \
rm -rf /var/lib/apt/lists/*

COPY requirements.txt /opt/release/requirements.txt

RUN pip install -r /opt/release/requirements.txt

RUN echo "PS1=\"[\u@nightly-tests] # \"" > ~/.bashrc
42 changes: 42 additions & 0 deletions setup/package.dfsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Please note that this Dockerfile is used for testing nightly builds and should
# not be used to deploy Odoo
FROM debian:stable
MAINTAINER Odoo S.A. <[email protected]>

# Change policy-rc.d so that services start automatically once installed
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d

RUN apt-get update && \
apt-get install -y locales && \
rm -rf /var/lib/apt/lists/*

# Reconfigure locales such that postgresql uses UTF-8 encoding
RUN dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8
ENV LC_ALL C.UTF-8

RUN apt-get update -qq && \
apt-get upgrade -qq -y && \
apt-get install \
postgresql \
postgresql-server-dev-all \
postgresql-client \
adduser \
libxml2-dev \
libxslt1-dev \
libldap2-dev \
libsasl2-dev \
libssl-dev \
libjpeg-dev \
python-dev \
python-pip \
build-essential \
python -y && \
rm -rf /var/lib/apt/lists/*

COPY requirements.txt /opt/release/requirements.txt

RUN pip install -r /opt/release/requirements.txt

RUN echo "PS1=\"[\u@nightly-tests] # \"" > ~/.bashrc
13 changes: 11 additions & 2 deletions setup/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,16 @@ def build_exe(o):
# Stage: testing
#----------------------------------------------------------
def _prepare_testing(o):
if not o.no_tarball or not o.no_debian:
if not o.no_tarball:
subprocess.call(["mkdir", "docker_src"], cwd=o.build_dir)
subprocess.call(["cp", "package.dfsrc", os.path.join(o.build_dir, "docker_src", "Dockerfile")],
cwd=os.path.join(o.odoo_dir, "setup"))
# Use rsync to copy requirements.txt in order to keep original permissions
subprocess.call(["rsync", "-a", "requirements.txt", os.path.join(o.build_dir, "docker_src")],
cwd=os.path.join(o.odoo_dir))
subprocess.call(["docker", "build", "-t", "odoo-%s-src-nightly-tests" % version, "."],
cwd=os.path.join(o.build_dir, "docker_src"))
if not o.no_debian:
subprocess.call(["mkdir", "docker_debian"], cwd=o.build_dir)
subprocess.call(["cp", "package.dfdebian", os.path.join(o.build_dir, "docker_debian", "Dockerfile")],
cwd=os.path.join(o.odoo_dir, "setup"))
Expand All @@ -305,7 +314,7 @@ def _prepare_testing(o):
cwd=os.path.join(o.build_dir, "docker_centos"))

def test_tgz(o):
with docker('odoo-%s-debian-nightly-tests' % version, o.build_dir, o.pub) as wheezy:
with docker('odoo-%s-src-nightly-tests' % version, o.build_dir, o.pub) as wheezy:
wheezy.release = '*.tar.gz'
wheezy.system("service postgresql start")
wheezy.system('/usr/local/bin/pip install /opt/release/%s' % wheezy.release)
Expand Down

0 comments on commit 520360d

Please sign in to comment.