Add formatting docker image

This commit is contained in:
2026-01-09 14:11:07 +01:00
parent 5b6f13ee80
commit 9b1947c521
4 changed files with 49 additions and 0 deletions

20
latex/fmt/build-image.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
set -e
echo "Build will be tagged with $1"
echo "Build directory is $(pwd)"
OLD_IMG=$(docker image ls -q "$1")
docker buildx build . -t "$1"
echo "Build complete, starting upload..."
docker push "$1"
if [ -n "$OLD_IMG" ]; then
if [ "$OLD_IMG" != "$(docker image ls -q "$1")" ]; then
echo "New build uploaded, removing old image, id: $OLD_IMG"
docker image rmi -f "$OLD_IMG" || true
echo "Exit status: $?"
fi
fi