blob: ce5dd521df9331cf860f2eaf8ad242a5b898b9d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/bash -e
die() {
echo >&2 "$@"
exit 1
}
(( $# >= 2 )) || die "Usage: $0 TOKEN-FILE SYMBOL-ARCHIVE..."
token="$1"
shift
[[ -f $token && -s $token ]] || die "Invalid TOKEN-FILE ${token@Q}"
for archive; do
[[ $(file -Ebi "$archive") == application/zip* ]] || die "Invalid SYMBOL-ARCHIVE ${archive@Q}"
done
for archive; do
echo >&2 "Uploading ${archive@Q} ..."
curl -X POST -H "Auth-Token: $(<"$token")" -F "${archive##*/}=@$archive" \
--retry 4 --retry-connrefused --connect-timeout 120 \
https://symbols.mozilla.org/upload/
echo
done
|