Skip to content

Commit

Permalink
[WIP] Use GCR registry mirror in Travis (#5735)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nkubala authored Apr 29, 2021
1 parent d1dde02 commit 21e3c95
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ branches:
git:
submodules: false

_registry_mirror: &registry_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
Expand Down Expand Up @@ -46,17 +55,20 @@ _upgrade_docker: &upgrade_docker
jobs:
include:
- os: linux
<<: *registry_mirror
name: "linters"
script:
- make linters
- os: linux
<<: *registry_mirror
name: "checks"
script:
- make checks
cache:
directories:
- $HOME/.cache/go-build
- os: linux
<<: *registry_mirror
name: "Linux unit"
script:
- make coverage
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 21e3c95

Please sign in to comment.