Skip to content

Commit 80eaf76

Browse files
authored
Merge pull request moodlehq#150 from stronk7/authenticated_docker
Login in dockerhub when possible to avoid pull limits
2 parents 94f0764 + c64cf3a commit 80eaf76

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/setup.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
set -e
33
basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
44

5+
# Log in dockerhub if possible (to avoid pull limits for unauthenticated uses).
6+
if [ -n "$DOCKER_USER" ] && [ -n "$DOCKER_TOKEN" ]; then
7+
echo "$DOCKER_TOKEN" | docker login -u "$DOCKER_USER" --password-stdin
8+
echo "Using authenticated connection (no pull limits)"
9+
else
10+
echo "Using unauthenticated docker (pull limits may apply). Setup DOCKER_USER and DOCKER_TOKEN if needed."
11+
fi
12+
513
if [ "$SUITE" = "phpunit" ];
614
then
715
initcmd="bin/moodle-docker-compose exec -T webserver php admin/tool/phpunit/cli/init.php"

0 commit comments

Comments
 (0)