devops: do not use du on windows (#13662)

`du` is not part of Firefox Build on windows, so let's use
node.js to workaround.
This commit is contained in:
Andrey Lushnikov 2022-04-20 13:09:04 -06:00 committed by GitHub
parent d1661f17ce
commit 87fb841267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,8 +71,10 @@ else
az storage blob upload -c builds --account-key "$AZ_ACCOUNT_KEY" --account-name "$AZ_ACCOUNT_NAME" -f "$ZIP_PATH" -n "$BLOB_PATH" --content-md5 "${MD5_HASH}"
fi
ZIP_SIZE=$(node -e 'console.log(Math.round(require("fs").statSync(process.argv[1]).size / 1024 / 1024) + "MB")' "${ZIP_PATH}")
echo "UPLOAD SUCCESSFUL!"
echo "-- SRC: $ZIP_PATH"
echo "-- SIZE: $(du -h "$ZIP_PATH" | awk '{print $1}')"
echo "-- SIZE: $ZIP_SIZE"
echo "-- DST: $BLOB_PATH"