aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-10-05 13:44:48 +0000
committerGerrit Code Review <review@openstack.org>2022-10-05 13:44:48 +0000
commit8decc98a9eecc7c8200de133693413172d6513c8 (patch)
tree441fd80ec721ad46ef177ac41b8e46ddf9accc4b /tests
parent446893d65da37c4c631a6ec27c24a80a6a3de13d (diff)
parent0c523e7f1b10ab0b456c20f4e900a6c8c6f7dcea (diff)
downloadkolla-8decc98a9eecc7c8200de133693413172d6513c8.tar.gz
kolla-8decc98a9eecc7c8200de133693413172d6513c8.zip
Merge "CI/centos/rocky: use repos from opendev mirror"
Diffstat (limited to 'tests')
-rw-r--r--tests/templates/template_overrides.j264
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|" \