[26988] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | ################################################################################
|
---|
| 4 | # Wrapper script to build, package, and transfer to ISSM Web site ISSM
|
---|
| 5 | # distributable package for Linux with Python 3 API.
|
---|
| 6 | #
|
---|
| 7 | # Normally, we would put this directly into the project configuration under
|
---|
[27111] | 8 | # 'Build' -> 'Execute shell', but because it is a bit more involved, it is a
|
---|
[26988] | 9 | # good idea to version it.
|
---|
| 10 | #
|
---|
| 11 | # When no failures/errors occur, performs the following:
|
---|
| 12 | # - Builds ISSM according to configuration.
|
---|
| 13 | # - Packages executables and libraries.
|
---|
| 14 | # - Runs test suite against package.
|
---|
| 15 | # - Transmits package to ISSM Web site for distribution.
|
---|
| 16 | #
|
---|
| 17 | # Options:
|
---|
| 18 | # -b/--skipbuild Skip ISSM compilation.
|
---|
| 19 | # -s/--skiptests Skip ISSM compilation and testing during packaging
|
---|
| 20 | # step. Use if packaging fails for some reason but build
|
---|
| 21 | # is valid.
|
---|
| 22 | # -t/--transferonly Transfer package to ISSM Web site only. Use if transfer
|
---|
| 23 | # fails for some reason to skip building, packaging, and
|
---|
| 24 | # signing.
|
---|
| 25 | #
|
---|
| 26 | # NOTE:
|
---|
| 27 | # - Use only *one* of the above options at a time, and make sure it is removed
|
---|
| 28 | # again after a single run.
|
---|
| 29 | # - Builds will fail when any of the above options are used on a clean
|
---|
| 30 | # workspace. For example, if 'Source Code Management' -> 'Check-out Strategy'
|
---|
| 31 | # select menu is set to "Always check out a fresh copy".
|
---|
| 32 | ################################################################################
|
---|
| 33 |
|
---|
| 34 | ## Constants
|
---|
| 35 | #
|
---|
| 36 | PKG="ISSM-Linux-Python-3" # Name of directory to copy distributable files to
|
---|
[28203] | 37 | PYTHON_NROPTIONS="--benchmark all --exclude 125:126 129 234:235 417:418 420 435 444:445 456 701:703 1101:1110 1201:1208 1301:1304 1401:1402 1601:1602 2002 2004 2006 2010:2013 2020:2021 2052:2053 2085 2090:2092 2424:2425 3001:3300 3480:3481 4001:4100" # 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
|
---|
[26988] | 38 |
|
---|
| 39 | COMPRESSED_PKG="${PKG}.tar.gz"
|
---|
| 40 |
|
---|
| 41 | ## Environment
|
---|
| 42 | #
|
---|
| 43 | export COMPRESSED_PKG
|
---|
| 44 | export PKG
|
---|
[28175] | 45 | export PYTHON_NROPTIONS
|
---|
[26988] | 46 |
|
---|
| 47 | ## Parse options
|
---|
| 48 | #
|
---|
| 49 | if [ $# -gt 1 ]; then
|
---|
| 50 | echo "Can use only one option at a time"
|
---|
| 51 | exit 1
|
---|
| 52 | fi
|
---|
| 53 |
|
---|
| 54 | # NOTE: We could do this with binary switching (i.e. 0011 to sign and transfer,
|
---|
| 55 | # but the following is self-documenting).
|
---|
| 56 | #
|
---|
| 57 | build=1
|
---|
| 58 | package=1
|
---|
| 59 | transfer=1
|
---|
| 60 |
|
---|
| 61 | if [ $# -eq 1 ]; then
|
---|
| 62 | case $1 in
|
---|
| 63 | -b|--skipbuild) build=0; shift ;;
|
---|
| 64 | -s|--skiptests) build=0; ;;
|
---|
| 65 | -t|--transferonly) build=0; package=0; ;;
|
---|
| 66 | *) echo "Unknown parameter passed: $1"; exit 1 ;;
|
---|
| 67 | esac
|
---|
| 68 | fi
|
---|
| 69 |
|
---|
| 70 | # Build
|
---|
| 71 | if [ ${build} -eq 1 ]; then
|
---|
| 72 | ./jenkins/jenkins.sh ./jenkins/ross-debian_linux-binaries-python-3
|
---|
| 73 |
|
---|
| 74 | if [ $? -ne 0 ]; then
|
---|
| 75 | exit 1
|
---|
| 76 | fi
|
---|
| 77 | fi
|
---|
| 78 |
|
---|
| 79 | # Package
|
---|
| 80 | if [ ${package} -eq 1 ]; then
|
---|
| 81 | ./packagers/linux/package-issm-linux-binaries-python-3.sh $1
|
---|
| 82 |
|
---|
| 83 | if [ $? -ne 0 ]; then
|
---|
| 84 | exit 1
|
---|
| 85 | fi
|
---|
| 86 | fi
|
---|
| 87 |
|
---|
| 88 | # Transfer distributable package to ISSM Web site
|
---|
| 89 | if [ ${transfer} -eq 1 ]; then
|
---|
| 90 | ./packagers/linux/transfer-issm-linux-binaries.sh
|
---|
| 91 |
|
---|
| 92 | if [ $? -ne 0 ]; then
|
---|
| 93 | exit 1
|
---|
| 94 | fi
|
---|
| 95 | fi
|
---|
| 96 |
|
---|