add support for non-github repos
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 17s
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 17s
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
# Abhängigkeiten installieren
|
# Abhängigkeiten installieren
|
||||||
RUN apk add --no-cache bash curl jq msmtp ca-certificates tzdata
|
RUN apk add --no-cache bash curl jq msmtp ca-certificates tzdata git
|
||||||
|
|
||||||
# Struktur anlegen
|
# Struktur anlegen
|
||||||
RUN mkdir /app /config
|
RUN mkdir /app /config
|
||||||
|
|||||||
@@ -69,8 +69,26 @@ EOF
|
|||||||
NEW_VAL=$(echo "$RESPONSE" | grep -i "docker-content-digest" | awk '{print $2}' | tr -d '\r')
|
NEW_VAL=$(echo "$RESPONSE" | grep -i "docker-content-digest" | awk '{print $2}' | tr -d '\r')
|
||||||
[[ -z "$NEW_VAL" ]] && NEW_VAL=$(echo "$RESPONSE" | grep -i "etag" | awk '{print $2}' | tr -d '\r' | tr -d '"')
|
[[ -z "$NEW_VAL" ]] && NEW_VAL=$(echo "$RESPONSE" | grep -i "etag" | awk '{print $2}' | tr -d '\r' | tr -d '"')
|
||||||
fi
|
fi
|
||||||
elif [ "$TYPE" == "GITHUB" ]; then
|
elif [ "$TYPE" == "GITHUB" ] || [ "$TYPE" == "GIT" ]; then
|
||||||
NEW_VAL=$(curl -s "https://api.github.com/repos/${REPO}/branches/${EXTRA}" | jq -r '.commit.sha // empty')
|
if [[ "$REPO" =~ ^http ]] || [[ "$REPO" == *"."* ]]; then
|
||||||
|
# FALL: Eigener Git-Server (Gitea, GitLab, etc.)
|
||||||
|
URL="$REPO"
|
||||||
|
[[ ! "$URL" =~ ^http ]] && URL="https://$URL"
|
||||||
|
|
||||||
|
echo " 🔍 Frage Git-Remote ab: $URL ($EXTRA)..."
|
||||||
|
|
||||||
|
# GIT_TERMINAL_PROMPT=0 verhindert das Warten auf Passworteingaben
|
||||||
|
# timeout 15s verhindert das Hängenbleiben bei toten Servern
|
||||||
|
NEW_VAL=$(GIT_TERMINAL_PROMPT=0 timeout 15s git ls-remote "$URL" "refs/heads/$EXTRA" 2>/dev/null | awk '{print $1}')
|
||||||
|
|
||||||
|
if [ $? -ne 0 ] || [ -z "$NEW_VAL" ]; then
|
||||||
|
echo " ⚠️ Fehler: Git-Server nicht erreichbar oder Repo privat/geschützt."
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# FALL: Klassisches GitHub Repo via API
|
||||||
|
NEW_VAL=$(curl -s --max-time 15 "https://api.github.com/repos/${REPO}/branches/${EXTRA}" | jq -r '.commit.sha // empty')
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$NEW_VAL" ] || [ "$NEW_VAL" == "null" ]; then
|
if [ -z "$NEW_VAL" ] || [ "$NEW_VAL" == "null" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user