Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
marko-k0 committed Jul 19, 2024
1 parent e744516 commit 2a95e0d
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions gitlab-ci/src/ci-scripts/before-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a95e0d

Please sign in to comment.