Bitbucket downloads

This commit is contained in:
2020-09-24 13:46:17 -05:00
parent d827c1f3c8
commit 689350f4ed
3 changed files with 16 additions and 56 deletions

View File

@@ -60,30 +60,20 @@ if npm run dist; then
APP_SHA256=$(cat ${OUT_FILE}.sha256 | awk '{print $1;}')
rm -f upload_response.json 1>/dev/null 2>&1
curl --fail -F name="${OUT_FILE}" -F anonymous=true -F file="@${OUT_FILE}" https://pixeldrain.com/api/file > upload_response.json || exit_script "Upload to Pixeldrain failed"
PIXEL_SUCCESS=$(${JQ_EXEC} .success upload_response.json)
if [ "${PIXEL_SUCCESS}" = "false" ]; then
PIXEL_MESSAGE=$(${JQ_EXEC} .message upload_response.json)
exit_script "${PIXEL_MESSAGE}"
else
PIXEL_ID=$(${JQ_EXEC} .id upload_response.json|sed s/\"//g)
PIXEL_LOCATION=https://pixeldrain.com/api/file/${PIXEL_ID}
upload_to_bitbucket "${OUT_FILE}"
upload_to_bitbucket "${OUT_FILE}.sha256"
upload_to_bitbucket "${OUT_FILE}.sig"
BITBUCKET_LOCATION=https://bitbucket.org/blockstorage/${REPOSITORY}/downloads/${OUT_FILE}
upload_to_bitbucket "${OUT_FILE}"
upload_to_bitbucket "${OUT_FILE}.sha256"
upload_to_bitbucket "${OUT_FILE}.sig"
BITBUCKET_LOCATION=https://bitbucket.org/blockstorage/${REPOSITORY}/downloads/${OUT_FILE}
cp -f ../releases.json ./releases.json
for DISTRONAME in ${DISTRO_LIST}; do
${JQ_EXEC} ".Versions[\"${DISTRONAME}\"]|=(.+ [\"${APP_VER}\"]|unique)" releases.json > releases_temp.json || exit_script "Update releases.json Versions failed"
${JQ_EXEC} ".Locations[\"${DISTRONAME}\"].\"${APP_VER}\".sig=\"${APP_SIG}\"" releases_temp.json > releases.json || exit_script "Update releases.json sig failed"
${JQ_EXEC} ".Locations[\"${DISTRONAME}\"].\"${APP_VER}\".sha256=\"${APP_SHA256}\"" releases.json > releases_temp.json || exit_script "Update releases.json sha256 failed"
${JQ_EXEC} ".Locations[\"${DISTRONAME}\"].\"${APP_VER}\".urls=[\"${PIXEL_LOCATION}\",\"${BITBUCKET_LOCATION}\"]" releases_temp.json > releases.json || exit_script "Update releases.json URL failed"
done
rm -f releases_temp.json
fi
cp -f ../releases.json ./releases.json
for DISTRONAME in ${DISTRO_LIST}; do
${JQ_EXEC} ".Versions[\"${DISTRONAME}\"]|=(.+ [\"${APP_VER}\"]|unique)" releases.json > releases_temp.json || exit_script "Update releases.json Versions failed"
${JQ_EXEC} ".Locations[\"${DISTRONAME}\"].\"${APP_VER}\".sig=\"${APP_SIG}\"" releases_temp.json > releases.json || exit_script "Update releases.json sig failed"
${JQ_EXEC} ".Locations[\"${DISTRONAME}\"].\"${APP_VER}\".sha256=\"${APP_SHA256}\"" releases.json > releases_temp.json || exit_script "Update releases.json sha256 failed"
${JQ_EXEC} ".Locations[\"${DISTRONAME}\"].\"${APP_VER}\".urls=[\"${BITBUCKET_LOCATION}\"]" releases_temp.json > releases.json || exit_script "Update releases.json URL failed"
done
rm -f releases_temp.json
fi
cd -
else