Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +13 -23
Dockerfile
CHANGED
|
@@ -30,31 +30,21 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 30 |
# -----------------------------
|
| 31 |
# SINGLE RUN with all ARGs + secret mount
|
| 32 |
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 33 |
-
echo "β
GITHUB_TOKEN is set" \
|
| 34 |
-
&& echo "π
|
| 35 |
-
&&
|
| 36 |
-
|
| 37 |
-
"https://api.github.com/repos/
|
| 38 |
| tee /tmp/releases.json \
|
| 39 |
-
&&
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
&& echo "π·οΈ Release tag: ${RELEASE_TAG}" \
|
| 41 |
-
&& if
|
| 42 |
-
&&
|
| 43 |
-
|
| 44 |
-
"https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases/tags/${RELEASE_TAG}" \
|
| 45 |
-
| jq -r ".assets[] | select(.name==\"${WHEEL_NAME}\") | .id") \
|
| 46 |
-
&& echo "π¦ Asset ID: ${ASSET_ID}" \
|
| 47 |
-
&& if [ -z "$ASSET_ID" ] || [ "$ASSET_ID" = "null" ]; then echo "β No asset found"; exit 1; fi \
|
| 48 |
-
&& echo "π₯ Downloading wheel..." \
|
| 49 |
-
&& curl -fL \
|
| 50 |
-
-H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
|
| 51 |
-
-H "Accept: application/octet-stream" \
|
| 52 |
-
-o /tmp/${WHEEL_NAME} \
|
| 53 |
-
"https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases/assets/${ASSET_ID}" \
|
| 54 |
-
&& echo "π¦ Installing wheel..." \
|
| 55 |
-
&& pip install --no-cache-dir /tmp/${WHEEL_NAME} \
|
| 56 |
-
&& rm -f /tmp/${WHEEL_NAME} /tmp/releases.json \
|
| 57 |
-
&& echo "β
Installed ${WHEEL_NAME}"
|
| 58 |
|
| 59 |
EXPOSE 7860
|
| 60 |
|
|
|
|
| 30 |
# -----------------------------
|
| 31 |
# SINGLE RUN with all ARGs + secret mount
|
| 32 |
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 33 |
+
echo "β
GITHUB_TOKEN is set (length: $(cat /run/secrets/GITHUB_TOKEN | wc -c) chars)" \
|
| 34 |
+
&& echo "π Testing API access..." \
|
| 35 |
+
&& curl -s -v \
|
| 36 |
+
-H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
|
| 37 |
+
"https://api.github.com/repos/chrisjcc/confluence-ingestor/releases" \
|
| 38 |
| tee /tmp/releases.json \
|
| 39 |
+
&& echo "=== RAW API RESPONSE ===" \
|
| 40 |
+
&& cat /tmp/releases.json \
|
| 41 |
+
&& echo "=== JQ ANALYSIS ===" \
|
| 42 |
+
&& cat /tmp/releases.json | jq -r 'type, length // "no length"' \
|
| 43 |
+
&& RELEASE_TAG=$(cat /tmp/releases.json | jq -r 'if type == "array" and length > 0 then .[0].tag_name else "ERROR_NO_RELEASES:\n" + (.message // "unknown") end') \
|
| 44 |
&& echo "π·οΈ Release tag: ${RELEASE_TAG}" \
|
| 45 |
+
&& if echo "$RELEASE_TAG" | grep -q ERROR; then cat /tmp/releases.json; exit 1; fi \
|
| 46 |
+
&& echo "β
Release found, continuing..." \
|
| 47 |
+
&& rm -f /tmp/releases.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
EXPOSE 7860
|
| 50 |
|