diff options
| author | Marcin Juszkiewicz <marcin.juszkiewicz+kolla@linaro.org> | 2022-09-27 19:21:44 +0200 |
|---|---|---|
| committer | Marcin Juszkiewicz <marcin.juszkiewicz+kolla@linaro.org> | 2022-10-03 15:29:05 +0200 |
| commit | 0c523e7f1b10ab0b456c20f4e900a6c8c6f7dcea (patch) | |
| tree | cd229394505f4453afd9085a21c5d6bdb854569c /tests | |
| parent | 28424514f392f50312af51ec20db3ea83d8cbf15 (diff) | |
| download | kolla-0c523e7f1b10ab0b456c20f4e900a6c8c6f7dcea.tar.gz kolla-0c523e7f1b10ab0b456c20f4e900a6c8c6f7dcea.zip | |
CI/centos/rocky: use repos from opendev mirror
Repo definitions in RHEL 9 rebuilds use metalink method for most of
entries which makes our use of sed obsolete.
This patch adds file with definitions of all CS9 repos we use and
moves all official definitions a side at start of build. After build our
definitions get removed and official ones are restored.
Similar is done for RockyLinux 9 builds but there RL9 repos are used
from official mirrors while CS9/EPEL ones are from OpenDev mirrors.
Final images will have repos in wrong enabled/disabled state.
Change-Id: I04121fd5ca9894b6deeda3808808cbffd6b97811
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/templates/template_overrides.j2 | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/tests/templates/template_overrides.j2 b/tests/templates/template_overrides.j2 index 96bf682b0..c9b5b23e8 100644 --- a/tests/templates/template_overrides.j2 +++ b/tests/templates/template_overrides.j2 @@ -18,20 +18,38 @@ RUN echo registry={{ nodepool_npmjs_proxy }} > /etc/npmrc \ {% endblock %} {% endraw %} -{% if base_distro == 'centos' %} +{% if base_distro in ['centos', 'rocky'] %} + {% if base_distro == 'centos' %} {% raw %} {% block base_centos_repo_overrides_post_copy %} {% endraw %} -RUN sed -i \ - -e "s|^\(mirrorlist.*\)|#\1|" \ - -e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \ - /etc/yum.repos.d/centos*.repo +COPY ci-centos.repo /etc/yum.repos.d/ +RUN cd /etc/yum.repos.d/ && mkdir not-for-ci/ && mv centos*.repo not-for-ci/ \ + && sed -i -e "s/MIRROR/{{ nodepool_mirror_host }}/g" /etc/yum.repos.d/ci-centos.repo + +{% raw %} +{% endblock %} +{% endraw %} + {% elif base_distro == 'rocky' %} +{# +NOTE(hrw): Rocky is not mirrored but it uses CentOS repos which are + #} +{% raw %} +{% block base_centos_repo_overrides_post_copy %} +{% endraw %} + +COPY ci-rocky.repo /etc/yum.repos.d/ +RUN cd /etc/yum.repos.d/ && mkdir not-for-ci/ \ + && sed -i -e "s/MIRROR/{{ nodepool_mirror_host }}/g" /etc/yum.repos.d/ci-rocky.repo {% raw %} {% endblock %} +{% endraw %} + {% endif %} {# if centos/rocky #} +{% raw %} {% block base_centos_repo_overrides_post_rpm %} {% endraw %} @@ -44,18 +62,7 @@ RUN sed -i \ {% block base_centos_repo_overrides_post_yum -%} {%- endraw -%} - && sed -i \ - -e "s|^\(mirrorlist.*\)|#\1|" \ - -e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \ - -e "s|^#baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \ - -e "s|^baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \ - -e "s|^baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \ - /etc/yum.repos.d/centos*.repo \ - && sed -i \ - -e "s|^\(metalink.*\)|#\1|" \ - -e "s|^#baseurl=http://download.example/pub|baseurl=http://{{ nodepool_mirror_host }}|" \ - -e "s|^#baseurl=https://download.example/pub|baseurl=http://{{ nodepool_mirror_host }}|" \ - /etc/yum.repos.d/epel*.repo \ + && cd /etc/yum.repos.d/ && mv CentOS*.repo epel*.repo not-for-ci/ {%- raw -%} {% endblock %} {% endraw %} @@ -97,18 +104,17 @@ RUN if [ -f /usr/etc/npmrc ]; then \ fi \ && rm -f /etc/npmrc -{% if base_distro == 'centos' %} -RUN sed -i \ - -e "s|^#\(mirrorlist.*\)|\1|" \ - -e "s|^baseurl=http://{{ nodepool_mirror_host }}|#baseurl=http://mirror.centos.org|" \ - /etc/yum.repos.d/centos*.repo \ - && sed -i \ - -e "s|{{ nodepool_rdo_proxy }}|https://trunk.rdoproject.org|g" \ - /etc/yum.repos.d/delorean*.repo \ - && sed -i \ - -e "s|^#\(metalink.*\)|\1|" \ - -e "s|^baseurl=http://{{ nodepool_mirror_host }}|#baseurl=http://download.example/pub|" \ - /etc/yum.repos.d/epel*.repo +{% if base_distro in ['centos', 'rocky'] %} +{# NOTE(hrw): Some images have two footer blocks. + For example neutron-infobox-ipam-agent being + child of neutron-server. +#} +RUN if [ -d /etc/yum.repos.d/not-for-ci/ ]; then \ + cd /etc/yum.repos.d/ && \ + rm ci-{{ base_distro }}.repo && \ + mv not-for-ci/*.repo . && \ + rm -rf not-for-ci; \ + fi {% elif base_distro == "debian" %} RUN sed -i -e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}|http://deb.debian.org|" \ -e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}|http://security.debian.org|" \ |
