add handling for non-docker-images
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 16s
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 16s
This commit is contained in:
@@ -3,7 +3,7 @@ services:
|
||||
image: git.pi-farm.de/pi-farm/multi-watch:1.0
|
||||
container_name: multi-watch
|
||||
volumes:
|
||||
- $(pwd)/config:/config
|
||||
- ./config:/config
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
restart: unless-stopped
|
||||
|
||||
|
||||
@@ -44,7 +44,20 @@ EOF
|
||||
NEW_VAL=""
|
||||
|
||||
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
|
||||
NEW_VAL=$(curl -s "https://api.github.com/repos/${REPO}/branches/${EXTRA}" | jq -r '.commit.sha // empty')
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user