chrisjcc commited on
Commit
56723fc
Β·
verified Β·
1 Parent(s): 78b8ab6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 "πŸ” Username: ${GITHUB_USERNAME}, Repo: ${GITHUB_REPO_NAME}" \
35
- && echo "πŸ” Fetching release tag..." \
36
- && curl -s -H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
37
- "https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases" \
38
  | tee /tmp/releases.json \
39
- && RELEASE_TAG=$(cat /tmp/releases.json | jq -r 'if type == "array" and length > 0 then .[0].tag_name else "ERROR_NO_RELEASES" end') \
 
 
 
 
40
  && echo "🏷️ Release tag: ${RELEASE_TAG}" \
41
- && if [ "$RELEASE_TAG" = "ERROR_NO_RELEASES" ]; then exit 1; fi \
42
- && ASSET_ID=$(curl -s \
43
- -H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
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