diff options
| author | Zuul <zuul@review.opendev.org> | 2021-01-11 11:58:53 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2021-01-11 11:58:53 +0000 |
| commit | e0faaaaefbf2ed8ddfd8265df29a819ac5949262 (patch) | |
| tree | 0679fa0855d62795c5e1b13b811a0743d45f1b9f /tests | |
| parent | c0eef769db3d951f1e051af49ffcd95b6d6dfb87 (diff) | |
| parent | 0fc464332c789ce05e9d6442726ada84ce7fc65a (diff) | |
| download | kolla-e0faaaaefbf2ed8ddfd8265df29a819ac5949262.tar.gz kolla-e0faaaaefbf2ed8ddfd8265df29a819ac5949262.zip | |
Merge "CI: revert to public package mirrors after build"
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/templates/template_overrides.j2 | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/tests/templates/template_overrides.j2 b/tests/templates/template_overrides.j2 index dfd98f715..d56c601e1 100644 --- a/tests/templates/template_overrides.j2 +++ b/tests/templates/template_overrides.j2 @@ -30,9 +30,10 @@ RUN echo 'APT::Get::AllowUnauthenticated "true";' > /etc/apt/apt.conf.d/99allow- {% endraw %} RUN sed -i \ - -e "/^mirrorlist/ d" \ + -e "s|^\(mirrorlist.*\)|#\1|" \ -e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \ /etc/yum.repos.d/CentOS-*.repo + {% raw %} {% endblock %} @@ -49,14 +50,14 @@ RUN sed -i \ {% block base_centos_repo_overrides_post_yum -%} {%- endraw -%} && sed -i \ - -e "/^mirrorlist/ d" \ + -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 "/^metalink/ d" \ + -e "s|^\(metalink.*\)|#\1|" \ -e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|" \ -e "s|^#baseurl=https://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|" \ /etc/yum.repos.d/epel*.repo @@ -83,4 +84,56 @@ RUN sed -i -e "s|mirror://mirrors.ubuntu.com/mirrors.txt|http://{{ nodepool_mirr {% raw %} {% endif %} {% endblock %} + +{# Revert to upstream mirrors after build is complete #} + +{% block footer %} +{% endraw %} + +ENV PIP_INDEX_URL= +ENV PIP_TRUSTED_HOST= +{% if use_infra_wheels_mirror | default(true) %} +ENV PIP_EXTRA_INDEX_URL= +{% endif %} + +RUN if [[ -f /usr/etc/npmrc ]]; then \ + unlink /usr/etc/npmrc; \ + fi \ + && rm -f /etc/npmrc + +{% raw %} +{% if base_package_type == 'rpm' %} +{% endraw %} +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.fedoraproject.org/pub|" \ + /etc/yum.repos.d/epel*.repo +{% raw %} +{% elif base_package_type == 'deb' %} +{% endraw %} +RUN rm -f /etc/apt/apt.conf.d/99allow-unauthenticated /etc/apt/apt.conf.d/99allow-insecure-repos +{% raw %} +{% if base_distro == "debian" %} +{% endraw %} +RUN sed -i -e "s|http://{{ nodepool_mirror_host }}|http://deb.debian.org|" \ + -e "s|http://{{ nodepool_mirror_host }}|http://security.debian.org|" \ + /etc/apt/sources.list +{% raw %} +{% elif base_distro == "ubuntu" %} +{% endraw %} +RUN sed -i -e "s|http://{{ nodepool_mirror_host }}/ubuntu/|mirror://mirrors.ubuntu.com/mirrors.txt|" \ + -e "s|http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|http://ubuntu-cloud.archive.canonical.com/ubuntu|" \ + -e "s|http://{{ nodepool_mirror_host }}/ubuntu-ports|http://ports.ubuntu.com|" \ + /etc/apt/sources.list +{% raw %} +{% endif %} +{% endif %} +{% endblock %} {% endraw %} |
