Skip to content

Commit

Permalink
Split downloading and untarring docker-credential-gcr to make the tar…
Browse files Browse the repository at this point in the history
…get (projectcalico#9560)

more robust.

This way, if the download fails, make will stop there. Also, added retry
to curl command for a little more robustness.
  • Loading branch information
coutinhop authored Dec 5, 2024
1 parent a581723 commit 0ed2982
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1447,9 +1447,9 @@ DOCKER_CREDENTIAL_OS="linux"
DOCKER_CREDENTIAL_ARCH="amd64"
$(WINDOWS_DIST)/bin/docker-credential-gcr:
-mkdir -p $(WINDOWS_DIST)/bin
curl -fsSL "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v$(DOCKER_CREDENTIAL_VERSION)/docker-credential-gcr_$(DOCKER_CREDENTIAL_OS)_$(DOCKER_CREDENTIAL_ARCH)-$(DOCKER_CREDENTIAL_VERSION).tar.gz" \
| tar xz --to-stdout docker-credential-gcr \
| tee $(WINDOWS_DIST)/bin/docker-credential-gcr > /dev/null && chmod +x $(WINDOWS_DIST)/bin/docker-credential-gcr
curl -fsSL --retry 5 "https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v$(DOCKER_CREDENTIAL_VERSION)/docker-credential-gcr_$(DOCKER_CREDENTIAL_OS)_$(DOCKER_CREDENTIAL_ARCH)-$(DOCKER_CREDENTIAL_VERSION).tar.gz" -o docker-credential-gcr.tar.gz
tar xzf docker-credential-gcr.tar.gz --to-stdout docker-credential-gcr | tee $@ > /dev/null && chmod +x $@
rm -f docker-credential-gcr.tar.gz

.PHONY: docker-credential-gcr-binary
docker-credential-gcr-binary: var-require-all-WINDOWS_DIST-DOCKER_CREDENTIAL_VERSION-DOCKER_CREDENTIAL_OS-DOCKER_CREDENTIAL_ARCH $(WINDOWS_DIST)/bin/docker-credential-gcr
Expand Down

0 comments on commit 0ed2982

Please sign in to comment.