Skip to content

Commit

Permalink
Login in dockerhub when possible to avoid pull limits
Browse files Browse the repository at this point in the history
With current pull limits @ dockerhub, it's possible to get failed
jobs just running 2-3 builds (each one having a good number of jobs).

With this patch, if both DOCKER_USER and DOCKER_TOKEN are defined
as environmental variables, they will be used to perform a login
to dockerhub, getting rid of pull limits.
  • Loading branch information
stronk7 committed Jan 16, 2021
1 parent 94f0764 commit c64cf3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
set -e
basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"

# Log in dockerhub if possible (to avoid pull limits for unauthenticated uses).
if [ -n "$DOCKER_USER" ] && [ -n "$DOCKER_TOKEN" ]; then
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USER" --password-stdin
echo "Using authenticated connection (no pull limits)"
else
echo "Using unauthenticated docker (pull limits may apply). Setup DOCKER_USER and DOCKER_TOKEN if needed."
fi

if [ "$SUITE" = "phpunit" ];
then
initcmd="bin/moodle-docker-compose exec -T webserver php admin/tool/phpunit/cli/init.php"
Expand Down

0 comments on commit c64cf3a

Please sign in to comment.