db-move: moved gcr from [testing] to [extra] (x86_64)
[arch-packages.git] / firefox / trunk / upload-symbol-archive
blob059a399c429f3ff16d10d3f96c0c9920de79f211
1 #!/bin/bash -e
3 die() {
4 echo >&2 "$@"
5 exit 1
8 (( $# >= 2 )) || die "Usage: $0 TOKEN-FILE SYMBOL-ARCHIVE..."
9 token="$1"
10 shift
12 [[ -f $token && -s $token ]] || die "Invalid TOKEN-FILE ${token@Q}"
14 for zip; do
15 [[ $(file -SEbi "$zip") == application/zip* ]] || die "Invalid SYMBOL-ARCHIVE ${zip@Q}"
16 done
18 for zip; do
19 echo >&2 "Uploading ${zip@Q} ..."
20 curl -X POST -H "Auth-Token: $(<"$token")" -F "${zip##*/}=@$zip" \
21 --retry 4 --retry-connrefused --connect-timeout 120 \
22 https://symbols.mozilla.org/upload/
23 echo
24 mv -v "$zip" "$zip.uploaded"
25 done