Commit 04bdbd2b authored by Stefan Bürk's avatar Stefan Bürk Committed by Oliver Bartsch
Browse files

[TASK] Additionally removes dangling docker volumes with runTests.sh -u

Over time dangling local anonymous docker volumes
pollutes local docker environments and consuming
space on core contributors discs.

This patch additionally removes dangling, unused
anonymous local docker volumes when updating core
testing images are requested with:

> Build/Scripts/runTests.sh -u

Resolves: #97361
Releases: main, 11.5, 10.4
Change-Id: I6b25a88a9ff119035eea7d5efd6c415bd490a3eb
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74271


Tested-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: Jochen's avatarJochen <rothjochen@gmail.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Jochen's avatarJochen <rothjochen@gmail.com>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent cdce612b
......@@ -190,10 +190,10 @@ Options:
Activate dry-run in CGL check that does not actively change files and only prints broken ones.
-u
Update existing typo3/core-testing-*:latest docker images. Maintenance call to docker pull latest
versions of the main php images. The images are updated once in a while and only the youngest
ones are supported by core testing. Use this if weird test errors occur. Also removes obsolete
image versions of typo3/core-testing-*.
Update existing typo3/core-testing-*:latest docker images and remove dangling local docker volumes.
Maintenance call to docker pull latest versions of the main php images. The images are updated once
in a while and only the latest ones are supported by core testing. Use this if weird test errors occur.
Also removes obsolete image versions of typo3/core-testing-*.
-v
Enable verbose script output. Shows variables and docker commands.
......@@ -735,10 +735,18 @@ case ${TEST_SUITE} in
docker-compose down
;;
update)
# prune unused, dangling local volumes
echo "> prune unused, dangling local volumes"
docker volume ls -q -f driver=local -f dangling=true | awk '$0 ~ /^[0-9a-f]{64}$/ { print }' | xargs -I {} docker volume rm {}
echo ""
# pull typo3/core-testing-*:latest versions of those ones that exist locally
echo "> pull typo3/core-testing-*:latest versions of those ones that exist locally"
docker images typo3/core-testing-*:latest --format "{{.Repository}}:latest" | xargs -I {} docker pull {}
echo ""
# remove "dangling" typo3/core-testing-* images (those tagged as <none>)
echo "> remove \"dangling\" typo3/core-testing-* images (those tagged as <none>)"
docker images typo3/core-testing-* --filter "dangling=true" --format "{{.ID}}" | xargs -I {} docker rmi {}
echo ""
;;
*)
echo "Invalid -s option argument ${TEST_SUITE}" >&2
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment