build: Configure newly uploaded repository file share link
This commit is contained in:
@@ -120,6 +120,7 @@ jobs:
|
|||||||
-d '{"email": "${{ secrets.REPO_USERNAME }}", "password": "${{ secrets.REPO_PASSWORD }}"}' | \
|
-d '{"email": "${{ secrets.REPO_USERNAME }}", "password": "${{ secrets.REPO_PASSWORD }}"}' | \
|
||||||
grep -oP 'connect\.sid=[^;]+' | head -n 1
|
grep -oP 'connect\.sid=[^;]+' | head -n 1
|
||||||
)
|
)
|
||||||
|
|
||||||
FILE_PATH="${{ steps.compress_image.outputs.image_path }}"
|
FILE_PATH="${{ steps.compress_image.outputs.image_path }}"
|
||||||
FILE_NAME="$(basename "$FILE_PATH" | sed 's/-compacted//')"
|
FILE_NAME="$(basename "$FILE_PATH" | sed 's/-compacted//')"
|
||||||
|
|
||||||
@@ -128,8 +129,15 @@ jobs:
|
|||||||
--header "Cookie: $REPO_TOKEN" \
|
--header "Cookie: $REPO_TOKEN" \
|
||||||
--form "uploadTo=/Storage/Repository/rel" \
|
--form "uploadTo=/Storage/Repository/rel" \
|
||||||
--form "filedata=@${FILE_PATH};filename=${FILE_NAME}"
|
--form "filedata=@${FILE_PATH};filename=${FILE_NAME}"
|
||||||
|
SHARE_URL=$(curl -fsSL -X POST \
|
||||||
|
http://nextexplorer.nextexplorer.svc.cluster.local:3000/api/shares \
|
||||||
|
--header "Content-Type: application/json" \
|
||||||
|
--header "Cookie: $REPO_TOKEN" \
|
||||||
|
-d '{"sourcePath":"Storage/Repository/rel/${FILE_NAME}"}' | \
|
||||||
|
jq -r '.directFileUrl'
|
||||||
|
)
|
||||||
|
|
||||||
curl -ksS -X PUT "https://lab-hv-vip.bessems.lan/v1/harvesterhci.io.virtualmachineimages" \
|
curl -ksS -X POST "https://lab-hv-vip.bessems.lan/v1/harvesterhci.io.virtualmachineimages" \
|
||||||
-H "Authorization: Bearer ${{ secrets.HV_TOKEN }}" \
|
-H "Authorization: Bearer ${{ secrets.HV_TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d @- <<EOF
|
-d @- <<EOF
|
||||||
@@ -139,9 +147,9 @@ jobs:
|
|||||||
"namespace": "default"
|
"namespace": "default"
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"displayName": "ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}",
|
"displayName": "$FILE_NAME",
|
||||||
"sourceType": "download",
|
"sourceType": "download",
|
||||||
"url": "https://${{ secrets.REPO_USERNAME }}:${{ secrets.REPO_PASSWORD }}@sn.itch.fyi/Repository/rel/ubuntu-${{ env.UBUNTU_VERSION }}-rke2-v${{ needs.semrel_dryrun.outputs.version }}.img"
|
"url": "$SHARE_URL?mode=download"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user