Skip to content

Commit

Permalink
Merge pull request #150 from stronk7/authenticated_docker
Browse files Browse the repository at this point in the history
Login in dockerhub when possible to avoid pull limits
  • Loading branch information
stronk7 authored Jan 17, 2021
2 parents 94f0764 + c64cf3a commit 80eaf76
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 80eaf76

Please sign in to comment.