forked from OCA/oca-github-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (56 loc) · 2.5 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM ubuntu:20.04
LABEL maintainer="Odoo Community Association (OCA)"
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
DEBIAN_FRONTEND=noninteractive
# binutils is needed for the ar command, used by pypandoc.ensure_pandoc_installed()
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
binutils \
ca-certificates \
curl \
git \
python3-venv \
rsync \
openssh-client \
&& rm -rf /var/lib/apt/lists/*
# The main branch bot needs several other command line tools from in OCA/maintainer-tools
# we install them in a separate virtualenv to avoid polluting our main environment.
# Install a specific version of icon generator, to ensure stability as any tiny change
# in generated output may create many commits on all addons.
RUN set -x \
&& python3 -m venv /ocamt-pinned \
&& /ocamt-pinned/bin/pip install --no-cache-dir -U pip wheel
RUN set -x \
&& /ocamt-pinned/bin/pip install --no-cache-dir -e git+https://github.com/OCA/maintainer-tools@969238e47c07d0c40573acff81d170f63245d738#egg=oca-maintainers-tools \
&& ln -s /ocamt-pinned/bin/oca-gen-addon-icon /usr/local/bin/
# Other oca maintainer tools that are less sensitive to changes. The README generator is
# not as sensitive as before because it now stores a hash of the fragments in the
# generated README.rst, so it will only regenerate if the fragments have changed.
RUN set -x \
&& python3 -m venv /ocamt \
&& /ocamt/bin/pip install --no-cache-dir -U pip wheel
RUN set -x \
&& /ocamt/bin/pip install --no-cache-dir -e git+https://github.com/OCA/maintainer-tools@969238e47c07d0c40573acff81d170f63245d738#egg=oca-maintainers-tools \
&& ln -s /ocamt/bin/oca-gen-addons-table /usr/local/bin/ \
&& ln -s /ocamt/bin/oca-gen-addon-readme /usr/local/bin/ \
&& ln -s /ocamt/bin/oca-towncrier /usr/local/bin/
RUN set -x \
&& /ocamt/bin/pip install --no-cache-dir 'setuptools-odoo>=3.0.3' \
&& ln -s /ocamt/bin/setuptools-odoo-make-default /usr/local/bin/
# isolate from system python libraries
RUN set -x \
&& python3 -m venv /app \
&& /app/bin/pip install --no-cache-dir -U pip wheel
ENV PATH=/app/bin:$PATH
# install oca_github_bot dependencies, in a separate layer for improved caching
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt
# install oca_github_bot app
COPY . /app/src/oca-github-bot
RUN pip install --no-cache-dir -e /app/src/oca-github-bot
# make work and home directory
RUN mkdir /app/run && chmod ogu+rwx /app/run
ENV HOME=/app/run
WORKDIR /app/run