From 21e3c954594cd46cbd7291c96cf05387d2751788 Mon Sep 17 00:00:00 2001 From: Nick Kubala Date: Thu, 29 Apr 2021 13:53:44 -0700 Subject: [PATCH] [WIP] Use GCR registry mirror in Travis (#5735) * Use GCR registry mirror in Travis * change to using before_script * try workaround using a tmp daemon.json file since apparently DOCKER_OPTS aren't respected * try configuring mirror only for linux tests * don't use registry mirror for kind tests --- .travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.travis.yml b/.travis.yml index 135fb96cc71..1ca469546cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,15 @@ branches: git: submodules: false +_registry_mirror: ®istry_mirror + before_script: + - tmpdaemon=$(mktemp) + - sudo jq '."registry-mirrors" += ["https://mirror.gcr.io"]' /etc/docker/daemon.json > $tmpdaemon + - sudo mv $tmpdaemon /etc/docker/daemon.json + - sudo systemctl daemon-reload + - sudo systemctl restart docker + - docker system info + install: # enable tcp_mtu_probing=1 to enable MTU path discovery when ICMP blackhole detected # bump fs.file-max to workaround rancher/k3d#407 @@ -46,10 +55,12 @@ _upgrade_docker: &upgrade_docker jobs: include: - os: linux + <<: *registry_mirror name: "linters" script: - make linters - os: linux + <<: *registry_mirror name: "checks" script: - make checks @@ -57,6 +68,7 @@ jobs: directories: - $HOME/.cache/go-build - os: linux + <<: *registry_mirror name: "Linux unit" script: - make coverage @@ -96,25 +108,30 @@ jobs: - name: "k3d integration partition 0" <<: *integration_test <<: *upgrade_docker + <<: *registry_mirror script: - env IT_PARTITION=0 make integration-in-k3d - name: "k3d integration partition 1" <<: *integration_test <<: *upgrade_docker + <<: *registry_mirror script: - env IT_PARTITION=1 make integration-in-k3d - name: "k3d integration partition 2" <<: *integration_test <<: *upgrade_docker + <<: *registry_mirror script: - env IT_PARTITION=2 make integration-in-k3d - name: "k3d integration partition 3" <<: *integration_test <<: *upgrade_docker + <<: *registry_mirror script: - env IT_PARTITION=3 make integration-in-k3d - os: linux name: "diag/Linux unit" + <<: *registry_mirror script: - make -f Makefile.diag coverage cache: