CI: CentOS - override mirrors ASAP + crmsh mirror override
This makes mirrored repos used as soon as they are installed in the image, instead of hitting upstreams. This patch also adds crmsh override. Usable only after infra change merges. Depends-on: https://review.opendev.org/682576 Change-Id: Ic7494eff4c740b6e528da4508dc88a64e697bc04 Signed-off-by: Radosław Piliszek <radoslaw.piliszek@gmail.com>
This commit is contained in:
parent
b8950dbfae
commit
6d853dc04e
|
@ -109,6 +109,8 @@ COPY yum.conf /etc/yum.conf
|
|||
COPY {{ repo_file }} /etc/yum.repos.d/{{ repo_file }}
|
||||
{%- endfor %}
|
||||
|
||||
{% block base_centos_repo_overrides_post_copy %}{% endblock %}
|
||||
|
||||
{{ macros.install_packages(base_yum_url_packages | customizable("yum_url_packages")) }}
|
||||
|
||||
{% for key in base_yum_repo_keys | customizable('yum_repo_keys') %}
|
||||
|
@ -123,6 +125,8 @@ COPY {{ repo_file }} /etc/yum.repos.d/{{ repo_file }}
|
|||
{{ cmd }}
|
||||
{% endfor %}
|
||||
|
||||
{% block base_centos_repo_overrides_post_rpm %}{% endblock %}
|
||||
|
||||
{% endif %}
|
||||
{# endif for repo setup for all RHEL except RHEL OSP #}
|
||||
|
||||
|
@ -166,7 +170,11 @@ RUN {{ macros.install_packages(base_centos_yum_repo_packages | customizable("cen
|
|||
{% for key in base_centos_yum_repo_keys | customizable('centos_yum_repo_keys') -%}
|
||||
&& rpm --import {{ key }} \
|
||||
{% endfor -%}
|
||||
&& {{ macros.rpm_security_update(clean_package_cache) }}
|
||||
&& /bin/true
|
||||
|
||||
{% block base_centos_repo_overrides_post_yum %}{% endblock %}
|
||||
|
||||
RUN {{ macros.rpm_security_update(clean_package_cache) }}
|
||||
|
||||
{%- endif %}
|
||||
{# Endif for base_distro centos #}
|
||||
|
|
|
@ -13,27 +13,46 @@ RUN echo registry={{ nodepool_npmjs_proxy }} > /etc/npmrc \
|
|||
|
||||
{% raw %}
|
||||
{% if base_distro == 'ubuntu' %}
|
||||
{% endraw %}
|
||||
|
||||
# NOTE(hrw): Debian 'buster' and Ubuntu 18.04 refuse to use unsigned repos
|
||||
RUN echo 'APT::Get::AllowUnauthenticated "true";' > /etc/apt/apt.conf.d/99allow-unauthenticated \
|
||||
&& echo 'Acquire::AllowInsecureRepositories "true";' > /etc/apt/apt.conf.d/99allow-insecure-repos
|
||||
|
||||
{% elif base_distro == 'centos' %}
|
||||
{% endraw %}
|
||||
|
||||
RUN sed -i -e "/^mirrorlist/ d" \
|
||||
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
|
||||
/etc/yum.repos.d/CentOS-Base.repo
|
||||
|
||||
{% raw %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block base_footer %}
|
||||
{% if base_distro == "centos" %}
|
||||
{% block base_centos_repo_overrides_post_copy %}
|
||||
{% endraw %}
|
||||
|
||||
RUN sed -i \
|
||||
-e "/^mirrorlist/ d" \
|
||||
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
|
||||
/etc/yum.repos.d/CentOS-*.repo \
|
||||
&& sed -i \
|
||||
-e "s|http://download.opensuse.org|http://{{ nodepool_mirror_host }}/opensuse|" \
|
||||
/etc/yum.repos.d/crmsh.repo \
|
||||
&& sed -i \
|
||||
-e "s|https://cbs.centos.org/repos|{{ nodepool_cbs_centos_proxy }}|g" \
|
||||
/etc/yum.repos.d/opendaylight.repo
|
||||
|
||||
{% raw %}
|
||||
{% endblock %}
|
||||
|
||||
{% block base_centos_repo_overrides_post_rpm %}
|
||||
{% endraw %}
|
||||
|
||||
RUN sed -i \
|
||||
-e "s|https://trunk.rdoproject.org|{{ nodepool_rdo_proxy }}|g" \
|
||||
/etc/yum.repos.d/delorean*.repo
|
||||
|
||||
{% raw %}
|
||||
{% endblock %}
|
||||
|
||||
{% block base_centos_repo_overrides_post_yum %}
|
||||
{% endraw %}
|
||||
|
||||
## TODO(yoctozepto): CentOS hits external EPEL repo for its repo package (epel-release-*.rpm), should use the mirrored
|
||||
RUN sed -i \
|
||||
-e "/^mirrorlist/ d" \
|
||||
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
|
||||
|
@ -41,14 +60,13 @@ RUN sed -i \
|
|||
&& sed -i \
|
||||
-e "/^metalink/ d" \
|
||||
-e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|" \
|
||||
/etc/yum.repos.d/epel*.repo \
|
||||
&& sed -i \
|
||||
-e "s|https://trunk.rdoproject.org|{{ nodepool_rdo_proxy }}|g" \
|
||||
-e "s|https://cbs.centos.org/repos|{{ nodepool_cbs_centos_proxy }}|g" \
|
||||
/etc/yum.repos.d/*.repo
|
||||
/etc/yum.repos.d/epel*.repo
|
||||
|
||||
{% raw %}
|
||||
{% elif base_distro == "ubuntu" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block base_footer %}
|
||||
{% if base_distro == "ubuntu" %}
|
||||
{% endraw %}
|
||||
|
||||
## TODO(yoctozepto): replace base repo earlier as well (like RHEL-based do)
|
||||
|
|
Loading…
Reference in New Issue