From c78d3e596a82a3d4b407a298c47f75ee6efe4ebc Mon Sep 17 00:00:00 2001 From: "Vladimir.Orlov" Date: Tue, 2 May 2017 15:52:58 +0300 Subject: [PATCH] IDEA-CR-20747 --- .../build-scripts/tools/mac/scripts/signapp.sh | 13 ++++++++----- .../build-scripts/tools/mac/scripts/signbin.sh | 15 +++++++++------ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/platform/build-scripts/tools/mac/scripts/signapp.sh b/platform/build-scripts/tools/mac/scripts/signapp.sh index 9afe76aec863..b4acba54813c 100644 --- a/platform/build-scripts/tools/mac/scripts/signapp.sh +++ b/platform/build-scripts/tools/mac/scripts/signapp.sh @@ -1,5 +1,8 @@ #!/bin/bash +#immediately exit script with an error if a command fails +set -euo pipefail + export COPY_EXTENDED_ATTRIBUTES_DISABLE=true export COPYFILE_DISABLE=true EXPLODED=$2.exploded @@ -69,22 +72,22 @@ security unlock-keychain -p ${PASSWORD} /Users/${USERNAME}/Library/Keychains/log attemp=1 limit=3 +set +e while [ $attemp -le $limit ] do echo "signing (attemp $attemp) ${EXPLODED}/$BUILD_NAME" codesign -v --deep --force -s "${CODESIGN_STRING}" ${EXPLODED}/"$BUILD_NAME" - echo "signing done" - codesign -v ${EXPLODED}/"$BUILD_NAME" -vvvvv - echo "check sign done" if [ "$?" != "0" ]; then let "attemp += 1" if [ $attemp -eq $limit ]; then - #immediately exit script with an error if a command fails - set -euo pipefail + set -e fi echo "wait for 30 sec and try to sign again" sleep 30; else + echo "signing done" + codesign -v ${EXPLODED}/"$BUILD_NAME" -vvvvv + echo "check sign done" let "attemp += $limit" fi done diff --git a/platform/build-scripts/tools/mac/scripts/signbin.sh b/platform/build-scripts/tools/mac/scripts/signbin.sh index ee0250f56ecc..ee1a1a118228 100644 --- a/platform/build-scripts/tools/mac/scripts/signbin.sh +++ b/platform/build-scripts/tools/mac/scripts/signbin.sh @@ -1,5 +1,8 @@ #!/bin/bash +#immediately exit script with an error if a command fails +set -euo pipefail + FILENAME=$1 USERNAME=$2 PASSWORD=$3 @@ -11,22 +14,22 @@ security unlock-keychain -p ${PASSWORD} /Users/${USERNAME}/Library/Keychains/log attemp=1 limit=3 +set +e while [ $attemp -le $limit ] do echo "signing (attemp $attemp) ${FILEPATH}" codesign -v --deep --force -s "${CODESIGN_STRING}" ${FILEPATH} - echo "signing done" - codesign -v ${FILEPATH} -vvvvv - echo "check sign done" if [ "$?" != "0" ]; then let "attemp += 1" if [ $attemp -eq $limit ]; then - #immediately exit script with an error if a command fails - set -euo pipefail + set -e fi echo "wait for 30 sec and try to sign again" sleep 30; else let "attemp += $limit" - fi + echo "signing done" + codesign -v ${FILEPATH} -vvvvv + echo "check sign done" + fi done