diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/templates/template_overrides.j2 | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/tests/templates/template_overrides.j2 b/tests/templates/template_overrides.j2 index 932917c3c..96bf682b0 100644 --- a/tests/templates/template_overrides.j2 +++ b/tests/templates/template_overrides.j2 @@ -16,7 +16,11 @@ RUN echo registry={{ nodepool_npmjs_proxy }} > /etc/npmrc \ {% raw %} {% endblock %} +{% endraw %} + +{% if base_distro == 'centos' %} +{% raw %} {% block base_centos_repo_overrides_post_copy %} {% endraw %} @@ -51,29 +55,30 @@ RUN 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 + /etc/yum.repos.d/epel*.repo \ {%- raw -%} {% endblock %} +{% endraw %} +{% endif %} +{% raw %} {% block base_debian_after_sources_list %} -{% if base_distro == "debian" %} {% endraw %} +{% if base_distro == "debian" %} RUN sed -i -e "s|http://deb.debian.org|[trusted=yes] http://{{ nodepool_mirror_host }}|" \ -e "s|http://security.debian.org|[trusted=yes] http://{{ nodepool_mirror_host }}|" \ /etc/apt/sources.list -{% raw %} {% elif base_distro == "ubuntu" %} -{% endraw %} RUN sed -i -e "s|mirror://mirrors.ubuntu.com/mirrors.txt|[trusted=yes] http://{{ nodepool_mirror_host }}/ubuntu/|" \ -e "s|http://ubuntu-cloud.archive.canonical.com/ubuntu|[trusted=yes] http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|" \ -e "s|http://ports.ubuntu.com|[trusted=yes] http://{{ nodepool_mirror_host }}/ubuntu-ports|" \ /etc/apt/sources.list -{% raw %} {% endif %} +{% raw %} {% endblock %} {# Revert to upstream mirrors after build is complete #} @@ -92,13 +97,11 @@ RUN if [ -f /usr/etc/npmrc ]; then \ fi \ && rm -f /etc/npmrc -{% raw %} -{% if base_package_type == 'rpm' %} -{% endraw %} +{% 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 \ + /etc/yum.repos.d/centos*.repo \ && sed -i \ -e "s|{{ nodepool_rdo_proxy }}|https://trunk.rdoproject.org|g" \ /etc/yum.repos.d/delorean*.repo \ @@ -106,22 +109,16 @@ RUN sed -i \ -e "s|^#\(metalink.*\)|\1|" \ -e "s|^baseurl=http://{{ nodepool_mirror_host }}|#baseurl=http://download.example/pub|" \ /etc/yum.repos.d/epel*.repo -{% raw %} -{% elif base_package_type == 'deb' %} -{% if base_distro == "debian" %} -{% endraw %} +{% 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|" \ /etc/apt/sources.list -{% raw %} {% elif base_distro == "ubuntu" %} -{% endraw %} RUN sed -i -e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}/ubuntu/|mirror://mirrors.ubuntu.com/mirrors.txt|" \ -e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|http://ubuntu-cloud.archive.canonical.com/ubuntu|" \ -e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}/ubuntu-ports|http://ports.ubuntu.com|" \ /etc/apt/sources.list -{% raw %} -{% endif %} {% endif %} +{% raw %} {% endblock %} {% endraw %} |
