diff --git a/14.0/Dockerfile b/14.0/Dockerfile index cc149da..e1ca54f 100644 --- a/14.0/Dockerfile +++ b/14.0/Dockerfile @@ -15,6 +15,9 @@ RUN pip install git+https://github.com/akretion/ak COPY repos.yml /root/.config/git-autoshare/repos.yml RUN pip install git-autoshare git-aggregator COPY bin/* /usr/local/bin/ +COPY install/* /install/ + +# pre-fetch the git-autoshare cache with the bare minimum: ADD https://api.github.com/repos/odoo/odoo/git/refs/heads/14.0 version.json RUN mkdir -p /root/.cache/git-autoshare/github.com/odoo && \ cd /root/.cache/git-autoshare/github.com/odoo && \ diff --git a/install/build-odoo b/install/build-odoo new file mode 100755 index 0000000..86c58fa --- /dev/null +++ b/install/build-odoo @@ -0,0 +1,25 @@ +#!/bin/bash +set -e +cd /odoo + +ak build -j1 -c odoo-spec.yaml -f odoo-frozen.yaml +echo "AK BUILD DONE" +# Clean useless file + +# Remove useless git directory +rm -rf /odoo/src/.git + +# First, we eventually keep only the wanted odoo modules +if [ -z "$(ls -A /odoo/links)" ]; then + echo "No addons set specified, keeping all addons" +else + cp -r -L /odoo/links /odoo/odoo-addons + rm -rf /odoo/src/addons/* + mv /odoo/odoo-addons/* /odoo/src/addons +fi + +# Second, we remove unwanted lang +if [[ -n "$BUILD_RESTRICT_LANG" ]]; then + find /odoo/src/ -name *.po ! -name $BUILD_RESTRICT_LANG -type f -exec rm -v {} + +fi +