Changeset 25893


Ignore:
Timestamp:
12/18/20 13:07:44 (4 years ago)
Author:
jdquinn
Message:

CHG: Split up macOS binaries Python packaging into multiple scripts as well; generalized transfer script

Location:
issm/trunk-jpl/packagers/mac
Files:
1 added
1 deleted
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/packagers/mac/commit_for_signing-issm-mac-binaries-python.sh

    r25890 r25893  
    22
    33################################################################################
    4 # Commits ISSM distributable package for macOS with MATLAB API to repository
     4# Commits ISSM distributable package for macOS with Python API to repository
    55# for signing. This repository is polled by a project running on a JPL
    66# Cybersecurity Jenkins server and performs the actual signing and
     
    2424#
    2525# See also:
    26 # - packagers/mac/complete-issm-mac-binaries-matlab.sh
    27 # - packagers/mac/sign-issm-mac-binaries-matlab.sh
     26# - packagers/mac/complete-issm-mac-binaries-python.sh
     27# - packagers/mac/sign-issm-mac-binaries-python.sh
    2828################################################################################
    2929
     
    6161SIGNING_LOCK_FILE="signing.lock"
    6262UNSIGNED_REPO_COPY="./unsigned"
    63 UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/unsigned"
     63UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
    6464
    6565## Functions
  • issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-matlab.sh

    r25891 r25893  
    112112# Transfer distributable package to ISSM Web site
    113113if [ ${transfer} -eq 1 ]; then
    114         ./packagers/mac/transfer-issm-mac-binaries-matlab.sh
     114        ./packagers/mac/transfer-issm-mac-binaries.sh
    115115fi
    116116
  • issm/trunk-jpl/packagers/mac/complete-issm-mac-binaries-python.sh

    r25891 r25893  
    33################################################################################
    44# Wrapper script to build, package, send for signing, and transfer to ISSM Web
    5 # site ISSM distributable package for macOS with MATLAB API.
     5# site ISSM distributable package for macOS with Python API.
    66#
    77# Normally, we would put this directly into the project configuration under
     
    3434#       Jenkins server. Debugging may be perfomed locally by running,
    3535#
    36 #               packagers/mac/sign-issm-mac-binaries-matlab.sh
     36#               packagers/mac/sign-issm-mac-binaries-python.sh
    3737#
    3838#       with "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" hardcoded to Apple
     
    5555## Constants
    5656#
    57 PKG="ISSM-macOS-MATLAB" # Name of directory to copy distributable files to
     57PKG="ISSM-macOS-Python" # Name of directory to copy distributable files to
    5858SIGNED_REPO_COPY="./signed"
    59 SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/matlab/signed"
     59SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/signed"
    6060
    6161COMPRESSED_PKG="${PKG}.zip"
     
    9696# Build
    9797if [ ${build} -eq 1 ]; then
    98         ./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-matlab
     98        ./jenkins/jenkins.sh ./jenkins/pine_island-mac-binaries-python
    9999fi
    100100
    101101# Package
    102102if [ ${package} -eq 1 ]; then
    103         ./packagers/mac/package-issm-mac-binaries-matlab.sh $1
     103        ./packagers/mac/package-issm-mac-binaries-python.sh $1
    104104        shift # Clear $1 so that it is not passed to commit_for_signing script
    105105fi
     
    107107# Commit for signing
    108108if [ ${sign} -eq 1 ]; then
    109         ./packagers/mac/commit_for_signing-issm-mac-binaries-matlab.sh $1
     109        ./packagers/mac/commit_for_signing-issm-mac-binaries-python.sh $1
    110110fi
    111111
    112112# Transfer distributable package to ISSM Web site
    113113if [ ${transfer} -eq 1 ]; then
    114         ./packagers/mac/transfer-issm-mac-binaries-matlab.sh
     114        ./packagers/mac/transfer-issm-mac-binaries.sh
    115115fi
    116116
  • issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python.sh

    r25879 r25893  
    22
    33################################################################################
    4 # To be used after running,
    5 #
    6 #       ${ISSM_DIR}/jenkins/jenkins.sh ${ISSM_DIR}/jenkins/pine_island-mac-binaries-python
    7 #
    8 # in the context of a Jenkins project.
    9 #
    10 # When no runtime errors occur, performs the following:
    11 # - Checks resulting executables and libraries against test suite.
    12 # - Packages and compresses executables and libraries.
    13 # - Commits compressed package to repository to be signed by JPL Cybersecurity.
    14 # - Retrieves signed package and transmits it to ISSM Web site for
    15 #       distribution.
     4# Packages and tests ISSM distributable package for macOS with Python API.
    165#
    176# Options:
    18 # -n/--notarizeonly             Sign/notarize only (use if signing/notarization fails
    19 #                                               to skip tests/packaging)
    20 # -s/--skiptests                Skip tests (use if this script fails for some reason
    21 #                                               after tests have successfully passed to save time)
    22 # -t/--transferonly             Transfer package to ISSM Web site only (use if
    23 #                                               transfer fails for some reason to skip testing and
    24 #                                               signing)
    25 # -u/--unlock                   Remove lock file from signed package repository (use if
    26 #                                               build is aborted to allow for subsequent fresh build)
    27 #
    28 # Debugging:
    29 # - Relies on a very tight handshake with project on remote JPL Cybersecurity
    30 #       Jenkins server. Debugging may be perfomed locally by running,
    31 #
    32 #               packagers/mac/sign-issm-mac-binaries-python.sh
    33 #
    34 #       with Apple Developer credentials.
    35 # - Removing stdout/stderr redirections to null device (> /dev/null 2>&1) can
    36 #       help debug potential SVN issues.
     7# -s/--skiptests                Skip tests and package only.
    378#
    389# NOTE:
    39 # - Assumes that "ISSM_BINARIES_USER" and "ISSM_BINARIES_PASS" are set up in
    40 #       the 'Bindings' section under a 'Username and password (separated)' binding
    41 #       (requires 'Credentials Binding Plugin').
    42 # - For local debugging, the aformentioned credentials can be hardcoded into
    43 #       the 'USERNAME' and 'PASSWORD' constants below.
     10# - Assumes that the following constants are defined,
     11#
     12#               COMPRESSED_PKG
     13#               ISSM_DIR
     14#               PKG
     15#
     16# See also:
     17# - packagers/mac/complete-issm-mac-binaries-python.sh
     18# - packagers/mac/sign-issm-mac-binaries-python.sh
    4419################################################################################
    4520
     
    7045## Constants
    7146#
    72 NOTARIZATION_LOGFILE="notarization.log"
    73 PASSWORD=${ISSM_BINARIES_PASS}
    74 PKG="ISSM-macOS-Python" # Name of directory to copy distributable files to
    7547PYTHON_NROPTIONS="--benchmark all --exclude 125 126 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2006 2020 2021 2051 2052 2053 3001:3200 3201 3202 3300 3480 3481 4001 4002 4003" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded
    76 RETRIGGER_SIGNING_FILE="retrigger.txt"
    77 SIGNED_REPO_COPY="./signed"
    78 SIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/signed"
    79 SIGNING_CHECK_PERIOD=60 # in seconds
    80 SIGNING_LOCK_FILE="signing.lock"
    81 UNSIGNED_REPO_COPY="./unsigned"
    82 UNSIGNED_REPO_URL="https://issm.ess.uci.edu/svn/issm-binaries/mac/python/unsigned"
    83 USERNAME=${ISSM_BINARIES_USER}
    84 
    85 COMPRESSED_PKG="${PKG}.zip"
    8648
    8749## Environment
     
    13395fi
    13496
    135 notarize_only=0
    13697skip_tests=0
    137 transfer_only=0
    138 unlock=0
    139 while [ $# -gt 0 ]; do
    140     case $1 in
    141         -n|--notarizeonly) notarize_only=1; shift ;;
    142         -s|--skiptests) skip_tests=1; shift ;;
    143         -t|--transferonly) transfer_only=1; shift ;;
    144         -u|--unlock) unlock=1; shift ;;
    145         *) echo "Unknown parameter passed: $1"; exit 1 ;;
    146     esac
    147     shift
    148 done
    149 
    150 if [ ${unlock} -eq 1 ]; then
    151         # Remove signing lock file from signed package repository so that a new
    152         # build can run
    153         echo "Removing lock file from repository for signed packages"
    154         checkout_signed_repo_copy
    155         svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
    156         svn delete ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
    157         svn commit \
    158                 --trust-server-cert \
    159                 --non-interactive \
    160                 --username ${USERNAME} \
    161                 --password ${PASSWORD} \
    162                 --message "DEL: Removing lock file after failed build" ${SIGNED_REPO_COPY}
    163         svn cleanup ${SIGNED_REPO_COPY}
    164         exit 1
    165 fi
    166 
    167 if [ ${transfer_only} -eq 0 ]; then
    168         rm -rf ${SIGNED_REPO_COPY}
    169 
    170         checkout_signed_repo_copy
    171 
    172         # If lock file exists, a signing build is still in process by JPL Cybersecurity
    173         svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
    174         if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
    175                 echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
     98
     99if [ $# -eq 1 ]; then
     100        case $1 in
     101                -s|--skiptests) skip_tests=1;                                   ;;
     102                *) echo "Unknown parameter passed: $1"; exit 1  ;;
     103        esac
     104fi
     105
     106# Add required binaries and libraries to package and modify them where needed
     107cd ${ISSM_DIR}/bin
     108
     109echo "Modify generic"
     110cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
     111
     112echo "Moving MPICH binaries to bin/"
     113if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
     114        cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
     115        cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
     116elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
     117        cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
     118        cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
     119else
     120        echo "MPICH not found"
     121        exit 1
     122fi
     123
     124echo "Moving GDAL binaries to bin/"
     125if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
     126        cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
     127        cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
     128else
     129        echo "GDAL not found"
     130        exit 1
     131fi
     132
     133echo "Moving GMT binaries to bin/"
     134if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
     135        cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
     136        cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
     137else
     138        echo "GMT not found"
     139        exit 1
     140fi
     141
     142echo "Moving Gmsh binaries to bin/"
     143if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
     144        cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
     145else
     146        echo "Gmsh not found"
     147        exit 1
     148fi
     149
     150# Run tests
     151if [ ${skip_tests} -eq 0 ]; then
     152        echo "Running tests"
     153        cd ${ISSM_DIR}/test/NightlyRun
     154        rm python.log 2> /dev/null
     155
     156        # Set Python environment
     157        export PYTHONPATH="${ISSM_DIR}/src/m/dev"
     158        export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
     159        export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
     160
     161        # Run tests, redirecting output to logfile and suppressing output to console
     162        ./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
     163
     164        # Check that Python did not exit in error
     165        pythonExitCode=`echo $?`
     166        pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
     167
     168        if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
     169                echo "----------Python exited in error!----------"
     170                cat python.log
     171                echo "-----------End of python.log-----------"
     172
     173                # Clean up execution directory
     174                rm -rf ${ISSM_DIR}/execution/*
     175
    176176                exit 1
    177177        fi
    178178
    179         if [ ${notarize_only} -eq 0 ]; then
    180                 # Clean up from previous packaging
    181                 echo "Cleaning up existing assets"
    182                 cd ${ISSM_DIR}
    183                 rm -rf ${PKG} ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
    184                 mkdir ${PKG}
    185 
    186                 # Check out copy of SVN repository for signed packages
    187                 #
    188                 # NOTE: Get empty copy because we do not want to have to check out package
    189                 #               from previous signing.
    190                 #
    191                 echo "Checking out copy of repository for signed packages"
    192                 svn checkout \
    193                         --trust-server-cert \
    194                         --non-interactive \
    195                         --username ${USERNAME} \
    196                         --password ${PASSWORD} \
    197                         --depth empty \
    198                         ${SIGNED_REPO_URL} \
    199                         ${SIGNED_REPO_COPY}
    200 
    201                 # If lock file exists, a signing build is still in process by JPL Cybersecurity
    202                 svn up ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
    203                 if [ -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
    204                         echo "Previous signing job still in process by JPL Cybersecurity. Please try again later."
    205                         exit 1
    206                 fi
    207 
    208                 # Add required binaries and libraries to package and modify them where needed
    209                 cd ${ISSM_DIR}/bin
    210 
    211                 echo "Modify generic"
    212                 cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py
    213 
    214                 echo "Moving MPICH binaries to bin/"
    215                 if [ -f ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec ]; then
    216                         cp ${ISSM_DIR}/externalpackages/petsc/install/bin/mpiexec .
    217                         cp ${ISSM_DIR}/externalpackages/petsc/install/bin/hydra_pmi_proxy .
    218                 elif [ -f ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec ]; then
    219                         cp ${ISSM_DIR}/externalpackages/mpich/install/bin/mpiexec .
    220                         cp ${ISSM_DIR}/externalpackages/mpich/install/bin/hydra_pmi_proxy .
    221                 else
    222                         echo "MPICH not found"
    223                         exit 1
    224                 fi
    225 
    226                 echo "Moving GDAL binaries to bin/"
    227                 if [ -f ${ISSM_DIR}/externalpackages/gdal/install/bin/gdal-config ]; then
    228                         cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdalsrsinfo .
    229                         cp ${ISSM_DIR}/externalpackages/gdal/install/bin/gdaltransform .
    230                 else
    231                         echo "GDAL not found"
    232                         exit 1
    233                 fi
    234 
    235                 echo "Moving GMT binaries to bin/"
    236                 if [ -f ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt-config ]; then
    237                         cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmt .
    238                         cp ${ISSM_DIR}/externalpackages/gmt/install/bin/gmtselect .
    239                 else
    240                         echo "GMT not found"
    241                         exit 1
    242                 fi
    243 
    244                 echo "Moving Gmsh binaries to bin/"
    245                 if [ -f ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh ]; then
    246                         cp ${ISSM_DIR}/externalpackages/gmsh/install/bin/gmsh .
    247                 else
    248                         echo "Gmsh not found"
    249                         exit 1
    250                 fi
    251 
    252                 # Run tests
    253                 if [ ${skip_tests} -eq 0 ]; then
    254                         echo "Running tests"
    255 
    256                         cd ${ISSM_DIR}/test/NightlyRun
    257                         rm python.log 2> /dev/null
    258 
    259                         # Set Python environment
    260                         export PYTHONPATH="${ISSM_DIR}/src/m/dev"
    261                         export PYTHONSTARTUP="${PYTHONPATH}/devpath.py"
    262                         export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured
    263 
    264                         # Run tests, redirecting output to logfile and suppressing output to console
    265                         ./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1
    266 
    267                         # Check that Python did not exit in error
    268                         pythonExitCode=`echo $?`
    269                         pythonExitedInError=`grep -E "Error|Standard exception|Traceback|bad interpreter" python.log | wc -l`
    270 
    271                         if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then
    272                                 echo "----------Python exited in error!----------"
    273                                 cat python.log
    274                                 echo "-----------End of python.log-----------"
    275 
    276                                 # Clean up execution directory
    277                                 rm -rf ${ISSM_DIR}/execution/*
    278 
    279                                 exit 1
    280                         fi
    281 
    282                         # Check that all tests passed
    283                         numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
    284 
    285                         if [ ${numTestsFailed} -ne 0 ]; then
    286                                 echo "One or more tests FAILED"
    287                                 exit 1
    288                         else
    289                                 echo "All tests PASSED"
    290                         fi
    291                 else
    292                         echo "Skipping tests"
    293                 fi
    294 
    295                 # Create package
    296                 cd ${ISSM_DIR}
    297                 svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
    298                 echo "Copying assets to package: ${PKG}"
    299                 cp -rf bin examples lib scripts test ${PKG}/
    300                 mkdir ${PKG}/execution
    301                 cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
    302                 ${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
    303                 echo "Cleaning up unneeded/unwanted files"
    304                 rm -f ${PKG}/bin/*.py # Remove all Python scripts
    305                 rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
    306                 rm -f ${PKG}/lib/*.a # Remove static libraries from package
    307                 rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
    308                 rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
    309 
    310                 # Compress package
    311                 echo "Compressing package"
    312                 ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
     179        # Check that all tests passed
     180        numTestsFailed=`cat python.log | grep -c -e "FAILED|ERROR"`
     181
     182        if [ ${numTestsFailed} -ne 0 ]; then
     183                echo "One or more tests FAILED"
     184                exit 1
    313185        else
    314                 # Assume that previous build was successful, but signing/notarization
    315                 # failed.
    316                 #
    317                 echo "Notarizing only"
     186                echo "All tests PASSED"
    318187        fi
    319 
    320         # Commit lock file to repository for signed packages
    321         echo "Committing lock file to repository for signed packages"
    322         touch ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
    323         svn add ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE}
    324         svn commit \
    325                 --trust-server-cert \
    326                 --non-interactive \
    327                 --username ${USERNAME} \
    328                 --password ${PASSWORD} \
    329                 --message "ADD: New lock file" ${SIGNED_REPO_COPY}
    330 
    331         # Check out copy of repository for unsigned packages
    332         checkout_unsigned_repo_copy
    333 
    334         if [ ${notarize_only} -eq 0 ]; then
    335                 # Commit new compressed package to repository for unsigned binaries
    336                 #
    337                 # NOTE: This will not work if, for any reason, the checksum on the compressed
    338                 #               package is unchanged.
    339                 #
    340                 echo "Committing package to repository for unsigned packages"
    341                 cp ${COMPRESSED_PKG} ${UNSIGNED_REPO_COPY}
    342                 svn add ${UNSIGNED_REPO_COPY}/${COMPRESSED_PKG}
    343                 svn commit \
    344                         --trust-server-cert \
    345                         --non-interactive \
    346                         --username ${USERNAME} \
    347                         --password ${PASSWORD} \
    348                         --message "CHG: New unsigned package" ${UNSIGNED_REPO_COPY}
    349         else
    350                 # NOTE: If notarize_only == 1, we commit a dummy file as the signing
    351                 #               build on the remote JPL Cybersecurity Jenkins server is
    352                 #               triggered by polling SCM.
    353                 #
    354                 echo "Attempting to sign existing package again"
    355                 echo $(date +'%Y-%m-%d-%H-%M-%S') > ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE} # Write datetime stamp to file to ensure modification is made
    356                 svn add ${UNSIGNED_REPO_COPY}/${RETRIGGER_SIGNING_FILE}
    357                 svn commit \
    358                         --trust-server-cert \
    359                         --non-interactive \
    360                         --username ${USERNAME} \
    361                         --password ${PASSWORD} \
    362                         --message "ADD: Retriggering signing with same package (previous attempt failed)" ${UNSIGNED_REPO_COPY}
    363         fi
    364 
    365         # Check status of signing
    366         echo "Checking progress of signing..."
    367         IN_PROCESS=1
    368         SUCCESS=0
    369 
    370         while [ ${IN_PROCESS} -eq 1 ]; do
    371                 echo "...in progress still; checking again in ${SIGNING_CHECK_PERIOD} seconds"
    372                 sleep ${SIGNING_CHECK_PERIOD}
    373                 svn up ${SIGNED_REPO_COPY}
    374 
    375                 if [ ! -f ${SIGNED_REPO_COPY}/${SIGNING_LOCK_FILE} ]; then
    376                         IN_PROCESS=0
    377 
    378                         # Retrieve notarization lock file
    379                         svn up ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
    380 
    381                         # Check status
    382                         STATUS=$(grep 'Status:' ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE} | sed -e 's/[[:space:]]*Status: //')
    383                         if [[ "${STATUS}" == "success" ]]; then
    384                                 echo "Notarization successful!"
    385 
    386                                 # Set flag indicating notarization was successful
    387                                 SUCCESS=1
    388                         else
    389                                 echo "Notarization failed!"
    390                         fi
    391                 fi
    392         done
    393 else
    394         # Assume that previous build resulted in successful signing of package but
    395         # that transfer to ISSM Web site failed and user built this project again
    396         # with -t/--transferonly option.
    397         #
    398 
    399         # Make sure copy of repository for signed packages exists
    400         validate_signed_repo_copy
    401 
    402         SUCCESS=1
    403 fi
    404 
    405 # Handle result of signing
    406 if [ ${SUCCESS} -eq 1 ]; then
    407         # Retrieve signed and notarized package
    408         svn up ${SIGNED_REPO_COPY}/${COMPRESSED_PKG}
    409 
    410         # Transfer signed package to ISSM Web site
    411         echo "Transferring signed package to ISSM Web site"
    412         scp -i ~/.ssh/pine_island_to_ross ${SIGNED_REPO_COPY}/${COMPRESSED_PKG} jenkins@ross.ics.uci.edu:/var/www/html/${COMPRESSED_PKG}
    413 
    414         if [ $? -ne 0 ]; then
    415                 echo "Transfer failed! Verify connection then build this project again (with -t/--transferonly option to skip testing and signing)."
    416                 exit 1
    417         fi
    418 else
    419         echo "----------------------- Contents of notarization logfile -----------------------"
    420         cat ${SIGNED_REPO_COPY}/${NOTARIZATION_LOGFILE}
    421         echo "--------------------------------------------------------------------------------"
    422 
    423         exit 1
    424 fi
     188else
     189        echo "Skipping tests"
     190fi
     191
     192# Create package
     193cd ${ISSM_DIR}
     194svn cleanup --remove-ignored --remove-unversioned test # Clean up test directory (before copying to package)
     195echo "Copying assets to package: ${PKG}"
     196cp -rf bin examples lib scripts test ${PKG}/
     197mkdir ${PKG}/execution
     198cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist
     199${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files
     200echo "Cleaning up unneeded/unwanted files"
     201rm -f ${PKG}/bin/*.py # Remove all Python scripts
     202rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes
     203rm -f ${PKG}/lib/*.a # Remove static libraries from package
     204rm -f ${PKG}/lib/*.la # Remove libtool libraries from package
     205rm -rf ${PKG}/test/SandBox # Remove testing sandbox from package
     206
     207# Compress package
     208echo "Compressing package"
     209ditto -ck --sequesterRsrc --keepParent ${PKG} ${COMPRESSED_PKG}
Note: See TracChangeset for help on using the changeset viewer.