forked from redis-stack/redis-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotarize.sh
37 lines (31 loc) · 1.11 KB
/
notarize.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
if [ -z $1 ]; then
echo "Usage: $0 {file_to_notarize.zip} {bundle name} {notarization username} {notarization password}"
exit 3
fi
ZIPFILE=$1 # path to zipfile
BUNDLE=$2 # eg com.redis.redis-stack-server
USERNAME=$3
PASSWORD=$4
TEAM_ID=$5
if [ ! -f ${ZIPFILE} ]; then
echo "${ZIPFILE} is not a file, exiting."
exit 3
fi
PACKAGE_ID=`xcrun notarytool submit ${ZIPFILE} --apple-id "${USERNAME}" --password "${PASSWORD}" --team-id "${TEAM_ID}" --wait|grep "id:" | head -1 | cut -d ":" -f 2-2|awk '{print $1}'`
echo "Checking status for package ${PACKAGE_ID}"
for i in `seq 1 20`; do
status=`xcrun notarytool info ${PACKAGE_ID} --apple-id "${USERNAME}" --password "${PASSWORD}" --team-id "${TEAM_ID}"|grep "status:" | head -1 | cut -d ":" -f 2-2|awk '{print $1}'`
echo "Status is - ${status}"
if [ "${status}" == "Accepted" ]; then
echo "Notarization succeeded!"
exit 0
else
echo "Notarization failed, exiting."
exit 1
fi
echo "Sleeping one minute between notarization checks".
sleep 60
done
echo "No succesful notarization found, exiting."
exit 1