From bd4ad276c0aec58a8852b848c190bd4b67e238f3 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 29 Apr 2021 04:57:05 +0300 Subject: DRTVWR-520 Notarize the viewer on TeamCity --- indra/newview/installers/darwin/apple-notarize.sh | 42 +++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 indra/newview/installers/darwin/apple-notarize.sh (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh new file mode 100644 index 0000000000..a590f52e38 --- /dev/null +++ b/indra/newview/installers/darwin/apple-notarize.sh @@ -0,0 +1,42 @@ +#!/bin/sh +​ +CONFIG_FILE="$build_secrets_checkout/code-signing-osx/notarize_creds.sh" +if [ -f "$CONFIG_FILE" ]; then + source $CONFIG_FILE + + app_file="$1" + zip_file=${app_file/app/zip} + ditto -c -k --keepParent "$app_file" "$zip_file" + ​ + ​ + requestUUID=$(xcrun altool --notarize-app --primary-bundle-id "com.secondlife.viewer" \ + --username $USERNAME \ + --password $PASSWORD \ + --asc-provider $ASC_PROVIDER \ + --file "$zip_file" 2>&1 \ + | awk '/RequestUUID/ { print $NF; }') + ​ + echo "Apple Notarization RequestUUID: $requestUUID" + ​ + if [[ -n $requestUUID ]]; then + status="in progress" + while [[ "$status" == "in progress" ]]; do + sleep 30 + status=$(xcrun altool --notarization-info "$requestUUID" \ + --username $USERNAME \ + --password $PASSWORD 2>&1 \ + | awk -F ': ' '/Status:/ { print $2; }' ) + echo "$status" + done + ​ + # log results + xcrun altool --notarization-info "$requestUUID" \ + --username $USERNAME \ + --password $PASSWORD + + if [["$status" == "success"]]; then + xcrun stapler staple "$app_file" + fi + fi +fi + -- cgit v1.2.3 From 2f7e9aac00b0c76210154ca209cd83fac7b8086d Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 29 Apr 2021 06:21:04 +0300 Subject: buildfix (chmod a+x) --- indra/newview/installers/darwin/apple-notarize.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/installers/darwin/apple-notarize.sh (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From 487685fef1ad4afdb1d6692a4ab6b2980205abd7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 29 Apr 2021 08:07:24 +0300 Subject: DRTVWR-520 Safety check; remove temporary zip file --- indra/newview/installers/darwin/apple-notarize.sh | 61 +++++++++++------------ 1 file changed, 30 insertions(+), 31 deletions(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh index a590f52e38..00d10b222a 100755 --- a/indra/newview/installers/darwin/apple-notarize.sh +++ b/indra/newview/installers/darwin/apple-notarize.sh @@ -1,42 +1,41 @@ #!/bin/sh -​ CONFIG_FILE="$build_secrets_checkout/code-signing-osx/notarize_creds.sh" if [ -f "$CONFIG_FILE" ]; then source $CONFIG_FILE - app_file="$1" zip_file=${app_file/app/zip} ditto -c -k --keepParent "$app_file" "$zip_file" - ​ - ​ - requestUUID=$(xcrun altool --notarize-app --primary-bundle-id "com.secondlife.viewer" \ - --username $USERNAME \ - --password $PASSWORD \ - --asc-provider $ASC_PROVIDER \ - --file "$zip_file" 2>&1 \ - | awk '/RequestUUID/ { print $NF; }') - ​ - echo "Apple Notarization RequestUUID: $requestUUID" - ​ - if [[ -n $requestUUID ]]; then - status="in progress" - while [[ "$status" == "in progress" ]]; do - sleep 30 - status=$(xcrun altool --notarization-info "$requestUUID" \ - --username $USERNAME \ - --password $PASSWORD 2>&1 \ - | awk -F ': ' '/Status:/ { print $2; }' ) - echo "$status" - done - ​ - # log results - xcrun altool --notarization-info "$requestUUID" \ - --username $USERNAME \ - --password $PASSWORD - - if [["$status" == "success"]]; then - xcrun stapler staple "$app_file" + if [ -f "$zip_file" ]; then + requestUUID=$(xcrun altool --notarize-app --primary-bundle-id "com.secondlife.viewer" \ + --username $USERNAME \ + --password $PASSWORD \ + --asc-provider $ASC_PROVIDER \ + --file "$zip_file" 2>&1 \ + | awk '/RequestUUID/ { print $NF; }') + + echo "Apple Notarization RequestUUID: $requestUUID" + + if [[ -n $requestUUID ]]; then + status="in progress" + while [[ "$status" == "in progress" ]]; do + sleep 30 + status=$(xcrun altool --notarization-info "$requestUUID" \ + --username $USERNAME \ + --password $PASSWORD 2>&1 \ + | awk -F ': ' '/Status:/ { print $2; }' ) + echo "$status" + done + # log results + xcrun altool --notarization-info "$requestUUID" \ + --username $USERNAME \ + --password $PASSWORD + + if [["$status" == "success"]]; then + xcrun stapler staple "$app_file" + fi fi + #remove temporary file + rm "$zip_file" fi fi -- cgit v1.2.3 From 02405a74d2bdaa3ecd6510eb198e1bf98cb1b051 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Sat, 1 May 2021 02:05:06 +0300 Subject: DRTVWR-520 Post-merge build fix + error handling improvement --- indra/newview/installers/darwin/apple-notarize.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh index 00d10b222a..b953af81af 100755 --- a/indra/newview/installers/darwin/apple-notarize.sh +++ b/indra/newview/installers/darwin/apple-notarize.sh @@ -30,12 +30,15 @@ if [ -f "$CONFIG_FILE" ]; then --username $USERNAME \ --password $PASSWORD + #remove temporary file + rm "$zip_file" + if [["$status" == "success"]]; then xcrun stapler staple "$app_file" + elif [["$status" == "invalid"]]; then + exit 1 fi fi - #remove temporary file - rm "$zip_file" fi fi -- cgit v1.2.3 From b58fb175829423412fd7ecab8b3f49ee474f92cc Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 14 Jul 2021 23:35:45 +0300 Subject: SL-15585 Improved notarization error handling --- indra/newview/installers/darwin/apple-notarize.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh index b953af81af..be0f8a5717 100755 --- a/indra/newview/installers/darwin/apple-notarize.sh +++ b/indra/newview/installers/darwin/apple-notarize.sh @@ -36,8 +36,12 @@ if [ -f "$CONFIG_FILE" ]; then if [["$status" == "success"]]; then xcrun stapler staple "$app_file" elif [["$status" == "invalid"]]; then + echo "Notarization error: failed to process the app file" exit 1 fi + elif + echo "Notarization error: couldn't get request UUID" + exit 1 fi fi fi -- cgit v1.2.3 From 11635dc5b80b9e65dd53cf9a66f3861c90818d0a Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 15 Jul 2021 00:58:07 +0300 Subject: SL-15585 typo fix --- indra/newview/installers/darwin/apple-notarize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh index be0f8a5717..2b3cce6078 100755 --- a/indra/newview/installers/darwin/apple-notarize.sh +++ b/indra/newview/installers/darwin/apple-notarize.sh @@ -39,7 +39,7 @@ if [ -f "$CONFIG_FILE" ]; then echo "Notarization error: failed to process the app file" exit 1 fi - elif + else echo "Notarization error: couldn't get request UUID" exit 1 fi -- cgit v1.2.3 From 54171dbc9fe3fa42ebbf59a243b7381fdb3aa662 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 19 Jul 2021 18:58:04 +0300 Subject: SL-15585 more logging for altool --- indra/newview/installers/darwin/apple-notarize.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh index 2b3cce6078..ecf5bd158a 100755 --- a/indra/newview/installers/darwin/apple-notarize.sh +++ b/indra/newview/installers/darwin/apple-notarize.sh @@ -6,12 +6,12 @@ if [ -f "$CONFIG_FILE" ]; then zip_file=${app_file/app/zip} ditto -c -k --keepParent "$app_file" "$zip_file" if [ -f "$zip_file" ]; then - requestUUID=$(xcrun altool --notarize-app --primary-bundle-id "com.secondlife.viewer" \ - --username $USERNAME \ - --password $PASSWORD \ - --asc-provider $ASC_PROVIDER \ - --file "$zip_file" 2>&1 \ - | awk '/RequestUUID/ { print $NF; }') + res=$(xcrun altool --notarize-app --primary-bundle-id "com.secondlife.viewer" \ + --username $USERNAME \ + --password $PASSWORD \ + --asc-provider $ASC_PROVIDER \ + --file "$zip_file" 2>&1) + requestUUID=$(echo $res | awk '/RequestUUID/ { print $NF; }') echo "Apple Notarization RequestUUID: $requestUUID" @@ -41,6 +41,7 @@ if [ -f "$CONFIG_FILE" ]; then fi else echo "Notarization error: couldn't get request UUID" + echo $res exit 1 fi fi -- cgit v1.2.3 From 30c0043ba3171726d008f2f573fc90107e612c73 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 21 Sep 2021 19:37:15 +0300 Subject: SL-15612 Check for SKIP_NOTARIZATION evn. variable --- indra/newview/installers/darwin/apple-notarize.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh index ecf5bd158a..2213914e6d 100755 --- a/indra/newview/installers/darwin/apple-notarize.sh +++ b/indra/newview/installers/darwin/apple-notarize.sh @@ -1,4 +1,9 @@ #!/bin/sh +if [ -n $SKIP_NOTARIZATION ]; then + echo "Skipping notarization" + exit 0 +fi + CONFIG_FILE="$build_secrets_checkout/code-signing-osx/notarize_creds.sh" if [ -f "$CONFIG_FILE" ]; then source $CONFIG_FILE -- cgit v1.2.3 From f2582cacf7746f42736d683eed8cad69f4cff6d7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 21 Sep 2021 19:42:43 +0300 Subject: SL-15612 Value fix --- indra/newview/installers/darwin/apple-notarize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh index 2213914e6d..466898ecda 100755 --- a/indra/newview/installers/darwin/apple-notarize.sh +++ b/indra/newview/installers/darwin/apple-notarize.sh @@ -1,5 +1,5 @@ #!/bin/sh -if [ -n $SKIP_NOTARIZATION ]; then +if [[ $SKIP_NOTARIZATION == "true" ]]; then echo "Skipping notarization" exit 0 fi -- cgit v1.2.3