From 2a95e0d50af9b642f5b31719baba0ce2e7742769 Mon Sep 17 00:00:00 2001 From: Marko Kosmerl Date: Fri, 19 Jul 2024 16:35:44 +0200 Subject: [PATCH] change --- gitlab-ci/src/ci-scripts/before-script.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/gitlab-ci/src/ci-scripts/before-script.sh b/gitlab-ci/src/ci-scripts/before-script.sh index cbcceab209c..db577296932 100755 --- a/gitlab-ci/src/ci-scripts/before-script.sh +++ b/gitlab-ci/src/ci-scripts/before-script.sh @@ -3,17 +3,15 @@ set -eEuo pipefail # login to docker hub to avoid rate limit disruptions -if [ -n "${DOCKER_HUB_USER:-}" ] && [ -n "${DOCKER_HUB_PASSWORD_RO:-}" ]; then - if which docker 2>/dev/null; then - docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD_RO" - fi - # docker-bin used by container_pull in WORKSPACES.bazel - if which docker-bin 2>/dev/null; then - # save auth to user's .docker/config.json - docker-bin login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD_RO" - # save auth to root's .docker/config.json - sudo docker-bin login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD_RO" - fi +if which docker 2>/dev/null; then + docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD_RO" +fi +# docker-bin used by container_pull in WORKSPACES.bazel +if which docker-bin 2>/dev/null; then + # save auth to user's .docker/config.json + docker-bin login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD_RO" + # save auth to root's .docker/config.json + sudo docker-bin login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD_RO" fi # print node name for easier debugging