Files
foundation/tools/gh-upload-backblaze.sh

15 lines
527 B
Bash
Raw Normal View History

2023-01-28 21:09:40 -08:00
#!/usr/bin/env bash
set -e
BACKBLAZE_B2_VERSION="3.6.0"
2023-01-28 21:26:20 -08:00
BACKBLAZE_B2_PLATFORM="linux"
BACKBLAZE_B2_REPO="https://github.com/Backblaze/B2_Command_Line_Tool"
2023-01-28 21:09:40 -08:00
2023-01-28 21:26:20 -08:00
[ "$(uname -s)" = "Darwin" ] && BACKBLAZE_B2_PLATFORM="darwin"
curl --fail -sL -o b2 "${BACKBLAZE_B2_REPO}/releases/download/v${BACKBLAZE_B2_VERSION}/b2-${BACKBLAZE_B2_PLATFORM}"
2023-01-28 21:09:40 -08:00
chmod +x b2
./b2 authorize-account "${ARTIFACTS_KEY_ID}" "${ARTIFACTS_APP_KEY}"
2023-01-28 21:26:20 -08:00
./b2 sync --delete --replaceNewer --allowEmptySource artifacts/ "b2://${ARTIFACTS_BUCKET}/foundation/"
rm b2