Changeset 25874


Ignore:
Timestamp:
12/15/20 14:39:49 (4 years ago)
Author:
jdquinn
Message:

CHG: Refinement of macOS packaging and signing scripts

Location:
issm/trunk-jpl/packagers/mac
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-matlab.sh

    r25873 r25874  
    8989#
    9090export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
    91 AGU
     91
     92## Functions
     93#
     94validate_signed_repo_copy(){
     95        # Check out copy of repository for signed binaries if it does not exist
     96        # (e.g. 'Check-out Strategy' was set to 'Use 'svn update' as much as
     97        # possible'; initial checkout failed)
     98        if [ ! -d ${SIGNED_REPO_COPY} && ! -d ${SIGNED_REPO_COPY}/.svn ]; then
     99                # Check out copy of SVN repository for signed packages
     100                #
     101                # NOTE: Get empty copy because we do not want to have to check out package from
     102                #               previous signing.
     103                #
     104                echo "Checking out copy of repository for signed packages"
     105                svn checkout \
     106                        --trust-server-cert \
     107                        --non-interactive \
     108                        --depth empty \
     109                        --username ${USERNAME} \
     110                        --password ${PASSWORD} \
     111                        ${SIGNED_REPO_URL} \
     112                        ${SIGNED_REPO_COPY} > /dev/null 2>&1
     113        fi
     114}
     115
    92116## Parse options
    93117#
     
    167191                # If lock file exists, a signing build is still in process by JPL Cybersecurity
    168192                svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
    169                 if [[ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]]; then
     193                if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
    170194                        echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
    171195                        exit 1
     
    243267                        numTestsFailed=`cat matlab.log | grep -c -e "FAILED|ERROR"`
    244268
    245                         if [[ ${numTestsFailed} -ne 0 ]]; then
     269                        if [ ${numTestsFailed} -ne 0 ]; then
    246270                                echo "One or more tests FAILED"
    247271                                exit 1
     
    269293                echo "Compressing package"
    270294                ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
     295        else
     296                # Assume that previous build was successful, but signing/notarization
     297                # failed.
     298                #
     299
     300                # Make sure copy of repository for signed packages exists
     301                validate_signed_repo_copy
    271302        fi
    272303
     
    360391        # that transfer to ISSM Web site failed and user built this project again
    361392        # with -t/--transferonly option.
     393        #
     394
     395        # Make sure copy of repository for signed packages exists
     396        validate_signed_repo_copy
     397
    362398        SUCCESS=1
    363399fi
  • issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh

    r25873 r25874  
    8888#
    8989export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages'
     90
     91## Functions
     92#
     93validate_signed_repo_copy(){
     94        # Check out copy of repository for signed binaries if it does not exist
     95        # (e.g. 'Check-out Strategy' was set to 'Use 'svn update' as much as
     96        # possible'; initial checkout failed)
     97        if [ ! -d ${SIGNED_REPO_COPY} && ! -d ${SIGNED_REPO_COPY}/.svn ]; then
     98                # Check out copy of SVN repository for signed packages
     99                #
     100                # NOTE: Get empty copy because we do not want to have to check out package from
     101                #               previous signing.
     102                #
     103                echo "Checking out copy of repository for signed packages"
     104                svn checkout \
     105                        --trust-server-cert \
     106                        --non-interactive \
     107                        --depth empty \
     108                        --username ${USERNAME} \
     109                        --password ${PASSWORD} \
     110                        ${SIGNED_REPO_URL} \
     111                        ${SIGNED_REPO_COPY} > /dev/null 2>&1
     112        fi
     113}
    90114
    91115## Parse options
     
    160184                # If lock file exists, a signing build is still in process by JPL Cybersecurity
    161185                svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} > /dev/null 2>&1
    162                 if [[ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]]; then
     186                if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
    163187                        echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
    164188                        exit 1
     
    242266                        numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
    243267
    244                         if [[ ${numTestsFailed} -ne 0 ]]; then
     268                        if [ ${numTestsFailed} -ne 0 ]; then
    245269                                echo "One or more tests FAILED"
    246270                                exit 1
     
    270294                echo "Compressing package"
    271295                ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
     296        else
     297                # Assume that previous build was successful, but signing/notarization
     298                # failed.
     299                #
     300
     301                # Make sure copy of repository for signed packages exists
     302                validate_signed_repo_copy
    272303        fi
    273304
     
    361392        # that transfer to ISSM Web site failed and user built this project again
    362393        # with -t/--transferonly option.
     394        #
     395
     396        # Make sure copy of repository for signed packages exists
     397        validate_signed_repo_copy
     398
    363399        SUCCESS=1
    364400fi
  • issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-matlab.sh

    r25873 r25874  
    167167# Check if UUID exists in response
    168168HAS_UUID=$(grep 'RequestUUID = ' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE}) # NOTE: Checking for "RequestUUID = " because "RequestUUID" shows up in some error messages
    169 if [[ -z "${HAS_UUID}" ]]; then
     169if [ -z "${HAS_UUID}" ]; then
    170170        echo "Notarization failed!"
    171171        echo "----------------------- Contents of notarization logfile -----------------------"
     
    199199                # First, check if there is an error
    200200                ERROR_CHECK=$(grep 'Error' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE})
    201                 if [[ ! -z "${ERROR_CHECK}" ]]; then
     201                if [ ! -z "${ERROR_CHECK}" ]; then
    202202                        break
    203203                fi
  • issm/trunk-jpl/packagers/mac/sign-issm-mac-binaries-python.sh

    r25873 r25874  
    176176# Check if UUID exists in response
    177177HAS_UUID=$(grep 'RequestUUID = ' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE}) # NOTE: Checking for "RequestUUID = " because "RequestUUID" shows up in some error messages
    178 if [[ -z "${HAS_UUID}" ]]; then
     178if [ -z "${HAS_UUID}" ]; then
    179179        echo "Notarization failed!"
    180180        echo "----------------------- Contents of notarization logfile -----------------------"
     
    208208                # First, check if there is an error
    209209                ERROR_CHECK=$(grep 'Error' ${NOTARIZATION_LOGFILE_PATH}/${NOTARIZATION_LOGFILE})
    210                 if [[ ! -z "${ERROR_CHECK}" ]]; then
     210                if [ ! -z "${ERROR_CHECK}" ]; then
    211211                        break
    212212                fi
Note: See TracChangeset for help on using the changeset viewer.