chrisjcc commited on
Commit
5ce5a2b
Β·
verified Β·
1 Parent(s): 5e55e89

Use API asset URL (.assets[0].url) instead of browser_download_url - this requires authentication properly

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -10
Dockerfile CHANGED
@@ -29,22 +29,26 @@ RUN pip install --no-cache-dir -r requirements.txt
29
  # Install private GitHub confluence-ingestor wheel using BuildKit secret
30
  # -----------------------------
31
  RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
32
- echo "βœ… GITHUB_TOKEN is set (length: $(cat /run/secrets/GITHUB_TOKEN | wc -c) chars)" \
33
  && echo "πŸ” Fetching latest release..." \
34
  && curl -s -L -H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
35
  "https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases/latest" \
36
  | tee /tmp/release.json \
37
- && ASSET_URL=$(cat /tmp/release.json | jq -r '.assets[0].browser_download_url // empty') \
38
- && if [ -z "$ASSET_URL" ]; then echo "❌ No wheel asset found"; cat /tmp/release.json; exit 1; fi \
39
- && echo "πŸ“₯ Downloading ${WHEEL_NAME} from ${ASSET_URL}" \
40
- && curl -s -L -o /tmp/${WHEEL_NAME} -H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
 
 
 
41
  "${ASSET_URL}" \
42
- && echo "πŸ”§ Installing wheel: $(ls -la /tmp/${WHEEL_NAME})" \
43
- && pip install --no-cache-dir /tmp/${WHEEL_NAME} \
 
 
44
  && rm -f /tmp/release.json /tmp/${WHEEL_NAME} \
45
- && echo "βœ… confluence_ingestor installed successfully" \
46
- && python -c "import confluence_ingestor; print('βœ“ Module import test passed')" || exit 1
47
-
48
 
49
  EXPOSE 7860
50
 
 
29
  # Install private GitHub confluence-ingestor wheel using BuildKit secret
30
  # -----------------------------
31
  RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
32
+ echo "βœ… GITHUB_TOKEN is set" \
33
  && echo "πŸ” Fetching latest release..." \
34
  && curl -s -L -H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
35
  "https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases/latest" \
36
  | tee /tmp/release.json \
37
+ && ASSET_URL=$(cat /tmp/release.json | jq -r '.assets[0].url // empty') \
38
+ && if [ -z "$ASSET_URL" ]; then echo "❌ No asset URL"; exit 1; fi \
39
+ && echo "πŸ“₯ Downloading from GitHub API asset URL: ${ASSET_URL}" \
40
+ && curl -s -L \
41
+ -H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
42
+ -H "Accept: application/octet-stream" \
43
+ -o /tmp/${WHEEL_NAME} \
44
  "${ASSET_URL}" \
45
+ && echo "πŸ“ Downloaded file size: $(ls -lh /tmp/${WHEEL_NAME})" \
46
+ && if [ ! -s /tmp/${WHEEL_NAME} ]; then echo "❌ Empty wheel file"; exit 1; fi \
47
+ && echo "πŸ”§ Installing wheel..." \
48
+ && pip install --no-cache-dir --verbose /tmp/${WHEEL_NAME} \
49
  && rm -f /tmp/release.json /tmp/${WHEEL_NAME} \
50
+ && python -c "import confluence_ingestor; print('βœ“ confluence_ingestor import OK')" \
51
+ && pip list | grep confluence || echo "βœ… Installation verified"
 
52
 
53
  EXPOSE 7860
54