Improve builder

This commit is contained in:
janishutz committed 2026-04-03 15:49:54 +02:00
1 parent b3a7877189
commit bbec6e3397
3 files changed
+20

No files matched your search

+20
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