add handling for non-docker-images
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 16s

This commit is contained in:
2026-02-06 21:43:15 +01:00
parent 2be56303c3
commit 22cf6223e3
2 changed files with 15 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ services:
image: git.pi-farm.de/pi-farm/multi-watch:1.0 image: git.pi-farm.de/pi-farm/multi-watch:1.0
container_name: multi-watch container_name: multi-watch
volumes: volumes:
- $(pwd)/config:/config - ./config:/config
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
restart: unless-stopped restart: unless-stopped

View File

@@ -44,7 +44,20 @@ EOF
NEW_VAL="" NEW_VAL=""
if [ "$TYPE" == "DOCKER" ]; then if [ "$TYPE" == "DOCKER" ]; then
NEW_VAL=$(curl -s "https://hub.docker.com/v2/repositories/${REPO}/tags/${EXTRA}" | jq -r '.last_updated // empty') if [[ "$REPO" == *"."* && "$REPO" == *"/"* ]]; then
# FALL: Eigene Registry (z.B. git.pi-farm.de)
# Wir versuchen hier den Docker-Standard-Weg über die Manifest-Config
# Hinweis: Das funktioniert ohne Auth nur bei öffentlichen Repos!
REGISTRY_HOST=$(echo $REPO | cut -d/ -f1)
IMAGE_NAME=$(echo $REPO | cut -d/ -f2-)
# Hole das Digest (eindeutiger Hash) des Images
NEW_VAL=$(curl -s -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
"https://${REGISTRY_HOST}/v2/${IMAGE_NAME}/manifests/${EXTRA}" | jq -r '.config.digest // empty')
else
# FALL: Normaler Docker Hub
NEW_VAL=$(curl -s "https://hub.docker.com/v2/repositories/${REPO}/tags/${EXTRA}" | jq -r '.last_updated // empty')
fi
elif [ "$TYPE" == "GITHUB" ]; then elif [ "$TYPE" == "GITHUB" ]; then
NEW_VAL=$(curl -s "https://api.github.com/repos/${REPO}/branches/${EXTRA}" | jq -r '.commit.sha // empty') NEW_VAL=$(curl -s "https://api.github.com/repos/${REPO}/branches/${EXTRA}" | jq -r '.commit.sha // empty')
fi fi