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: debian7)
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"
75 . $WORKSPACE/build/run-library.sh
77 title "Start build packages"
80 $WORKSPACE/build/run-build-packages-one-target.sh --target $TARGET
82 checkexit $? "build packages"
83 title "End of build packages (`timer`)"
85 #/usr/bin/sudo chown jenkins:jenkins $WORKSPACE/packages -R
87 title "Start test packages"
90 if [ ${#failures[@]} -eq 0 ]; then
91 $WORKSPACE/build/run-build-packages-one-target.sh --target $TARGET --test-packages
93 echo "Skipping package upload, there were errors building the packages"
96 checkexit $? "test packages"
97 title "End of test packages (`timer`)"
99 if [[ "$UPLOAD" != 0 ]]; then
100 title "Start upload packages"
103 if [ ${#failures[@]} -eq 0 ]; then
104 /usr/local/arvados-dev/jenkins/run_upload_packages.py -H jenkinsapt@apt.arvados.org -o Port=2222 --workspace $WORKSPACE $TARGET
106 echo "Skipping package upload, there were errors building and/or testing the packages"
108 checkexit $? "upload packages"
109 title "End of upload packages (`timer`)"