3 read -rd "\000" helpmessage <<EOF
4 $(basename $0): Build, test and (optionally) upload packages for one target
7 WORKSPACE=/path/to/arvados $(basename $0) [options]
10 Distribution to build packages for (default: debian8)
12 If the build and test steps are successful, upload the packages
13 to a remote apt repository (default: false)
15 WORKSPACE=path Path to the Arvados source tree to build packages from
19 if ! [[ -n "$WORKSPACE" ]]; then
20 echo >&2 "$helpmessage"
22 echo >&2 "Error: WORKSPACE environment variable not set"
27 if ! [[ -d "$WORKSPACE" ]]; then
28 echo >&2 "$helpmessage"
30 echo >&2 "Error: $WORKSPACE is not a directory"
35 PARSEDOPTS=$(getopt --name "$0" --longoptions \
45 eval set -- "$PARSEDOPTS"
46 while [ $# -gt 0 ]; do
49 echo >&2 "$helpmessage"
61 echo >&2 "$0: unrecognized argument '$2'. Try: $0 --help"
76 . $WORKSPACE/build/run-library.sh
78 title "Start build packages"
81 $WORKSPACE/build/run-build-packages-one-target.sh --target $TARGET
83 checkexit $? "build packages"
84 title "End of build packages (`timer`)"
86 title "Start test packages"
89 if [ ${#failures[@]} -eq 0 ]; then
90 $WORKSPACE/build/run-build-packages-one-target.sh --target $TARGET --test-packages
92 echo "Skipping package upload, there were errors building the packages"
95 checkexit $? "test packages"
96 title "End of test packages (`timer`)"
98 if [[ "$UPLOAD" != 0 ]]; then
99 title "Start upload packages"
102 if [ ${#failures[@]} -eq 0 ]; then
103 /usr/local/arvados-dev/jenkins/run_upload_packages.py -H jenkinsapt@apt.arvados.org -o Port=2222 --workspace $WORKSPACE $TARGET
105 echo "Skipping package upload, there were errors building and/or testing the packages"
107 checkexit $? "upload packages"
108 title "End of upload packages (`timer`)"