From d769d30c8284068301ce339fe6bede105ba6b8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Fri, 18 Aug 2023 00:23:04 -0300 Subject: [PATCH] optimized builder images --- 12.0/Dockerfile | 19 ++++++++++--------- 13.0/Dockerfile | 19 ++++++++++--------- 15.0/Dockerfile | 19 ++++++++++--------- 16.0/Dockerfile | 19 ++++++++++--------- bin/git | 9 --------- repos.yml | 8 -------- 6 files changed, 40 insertions(+), 53 deletions(-) delete mode 100755 bin/git delete mode 100644 repos.yml diff --git a/12.0/Dockerfile b/12.0/Dockerfile index f13c804..b81084f 100644 --- a/12.0/Dockerfile +++ b/12.0/Dockerfile @@ -12,15 +12,16 @@ RUN apk fix && \ RUN pip install PyYaml==5.3.1 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/ +RUN pip install git-aggregator COPY install/* /install/ -# pre-fetch the git-autoshare cache with the bare minimum: +# pre-fetch /odoo/src for CoW git-aggregator convergence atop of it. ADD https://api.github.com/repos/odoo/odoo/git/refs/heads/12.0 version.json -RUN mkdir -p /root/.cache/git-autoshare/github.com/odoo && \ - cd /root/.cache/git-autoshare/github.com/odoo && \ - /usr/bin/git init --bare && \ - /usr/bin/git fetch https://github.com/OCA/OCB.git refs/heads/12.0:refs/git-autoshare/oca/heads/12.0 --shallow-since=2018-10-01 && \ - /usr/bin/git fetch https://github.com/odoo/odoo.git refs/heads/12.0:refs/git-autoshare/odoo/heads/12.0 --shallow-since=2018-10-01 +RUN mkdir -p /odoo/src && \ + cd /odoo/src && \ + git init && \ + git remote add odoo https://github.com/odoo/odoo && \ + git fetch odoo 12.0 --filter=blob:none && \ + git remote add oca https://github.com/oca/ocb && \ + git fetch oca 12.0 && \ + git checkout remotes/oca/12.0 diff --git a/13.0/Dockerfile b/13.0/Dockerfile index 585feb5..2118f33 100644 --- a/13.0/Dockerfile +++ b/13.0/Dockerfile @@ -12,15 +12,16 @@ RUN apk fix && \ RUN pip install PyYaml==5.3.1 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/ +RUN pip install git-aggregator COPY install/* /install/ -# pre-fetch the git-autoshare cache with the bare minimum: +# pre-fetch /odoo/src for CoW git-aggregator convergence atop of it. ADD https://api.github.com/repos/odoo/odoo/git/refs/heads/13.0 version.json -RUN mkdir -p /root/.cache/git-autoshare/github.com/odoo && \ - cd /root/.cache/git-autoshare/github.com/odoo && \ - /usr/bin/git init --bare && \ - /usr/bin/git fetch https://github.com/OCA/OCB.git refs/heads/13.0:refs/git-autoshare/oca/heads/13.0 --shallow-since=2019-10-01 && \ - /usr/bin/git fetch https://github.com/odoo/odoo.git refs/heads/13.0:refs/git-autoshare/odoo/heads/13.0 --shallow-since=2019-10-01 +RUN mkdir -p /odoo/src && \ + cd /odoo/src && \ + git init && \ + git remote add odoo https://github.com/odoo/odoo && \ + git fetch odoo 13.0 --filter=blob:none && \ + git remote add oca https://github.com/oca/ocb && \ + git fetch oca 13.0 && \ + git checkout remotes/oca/13.0 diff --git a/15.0/Dockerfile b/15.0/Dockerfile index f10d097..d0aaae1 100644 --- a/15.0/Dockerfile +++ b/15.0/Dockerfile @@ -12,15 +12,16 @@ RUN apk fix && \ RUN pip install PyYaml==5.3.1 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/ +RUN pip install git-aggregator COPY install/* /install/ -# pre-fetch the git-autoshare cache with the bare minimum: +# pre-fetch /odoo/src for CoW git-aggregator convergence atop of it. ADD https://api.github.com/repos/odoo/odoo/git/refs/heads/15.0 version.json -RUN mkdir -p /root/.cache/git-autoshare/github.com/odoo && \ - cd /root/.cache/git-autoshare/github.com/odoo && \ - /usr/bin/git init --bare && \ - /usr/bin/git fetch https://github.com/OCA/OCB.git refs/heads/15.0:refs/git-autoshare/oca/heads/15.0 --shallow-since=2021-10-01 && \ - /usr/bin/git fetch https://github.com/odoo/odoo.git refs/heads/15.0:refs/git-autoshare/odoo/heads/15.0 --shallow-since=2021-10-01 +RUN mkdir -p /odoo/src && \ + cd /odoo/src && \ + git init && \ + git remote add odoo https://github.com/odoo/odoo && \ + git fetch odoo 15.0 --filter=blob:none && \ + git remote add oca https://github.com/oca/ocb && \ + git fetch oca 15.0 && \ + git checkout remotes/oca/15.0 diff --git a/16.0/Dockerfile b/16.0/Dockerfile index d0dd9b0..b5276ad 100644 --- a/16.0/Dockerfile +++ b/16.0/Dockerfile @@ -12,15 +12,16 @@ RUN apk fix && \ RUN pip install PyYaml==5.3.1 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/ +RUN pip install git-aggregator COPY install/* /install/ -# pre-fetch the git-autoshare cache with the bare minimum: +# pre-fetch /odoo/src for CoW git-aggregator convergence atop of it. ADD https://api.github.com/repos/odoo/odoo/git/refs/heads/16.0 version.json -RUN mkdir -p /root/.cache/git-autoshare/github.com/odoo && \ - cd /root/.cache/git-autoshare/github.com/odoo && \ - /usr/bin/git init --bare && \ - /usr/bin/git fetch https://github.com/OCA/OCB.git refs/heads/16.0:refs/git-autoshare/oca/heads/16.0 --shallow-since=2022-10-01 && \ - /usr/bin/git fetch https://github.com/odoo/odoo.git refs/heads/16.0:refs/git-autoshare/odoo/heads/16.0 --shallow-since=2022-10-01 +RUN mkdir -p /odoo/src && \ + cd /odoo/src && \ + git init && \ + git remote add odoo https://github.com/odoo/odoo && \ + git fetch odoo 16.0 --filter=blob:none && \ + git remote add oca https://github.com/oca/ocb && \ + git fetch oca 16.0 && \ + git checkout remotes/oca/16.0 diff --git a/bin/git b/bin/git deleted file mode 100755 index cd1d6fe..0000000 --- a/bin/git +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -if [ "$1" == "clone" ] -then - shift - echo "========== USING GIT AUTOSHARE ==========" - /usr/bin/git autoshare-clone "$@" -else - /usr/bin/git "$@" -fi diff --git a/repos.yml b/repos.yml deleted file mode 100644 index 516aeb2..0000000 --- a/repos.yml +++ /dev/null @@ -1,8 +0,0 @@ -github.com: - "*": - orgs: - - odoo - - OCA - - acsone - - akretion - - camptocamp