2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
6 read -rd "\000" helpmessage <<EOF
7 $(basename $0): Orchestrate run-build-packages.sh for every target
10 WORKSPACE=/path/to/arvados $(basename $0) [options]
15 Build command to execute (default: use built-in Docker image command)
17 Run package install tests
19 Output debug information (default: false)
20 --build-version <string>
21 Version to build (default:
22 \$ARVADOS_BUILDING_VERSION-\$ARVADOS_BUILDING_ITERATION or
23 0.1.timestamp.commithash)
25 WORKSPACE=path Path to the Arvados source tree to build packages from
29 if ! [[ -n "$WORKSPACE" ]]; then
30 echo >&2 "$helpmessage"
32 echo >&2 "Error: WORKSPACE environment variable not set"
37 if ! [[ -d "$WORKSPACE" ]]; then
38 echo >&2 "$helpmessage"
40 echo >&2 "Error: $WORKSPACE is not a directory"
47 PARSEDOPTS=$(getopt --name "$0" --longoptions \
48 help,test-packages,debug,command:,only-test:,build-version: \
59 eval set -- "$PARSEDOPTS"
60 while [ $# -gt 0 ]; do
63 echo >&2 "$helpmessage"
74 TEST_PACKAGES="--test-packages"
77 ONLY_TEST="$1 $2"; shift
80 ARVADOS_BUILDING_VERSION="$2"; shift
84 echo >&2 "$0: unrecognized argument '$2'. Try: $0 --help"
96 for dockerfile_path in $(find -name Dockerfile | grep package-build-dockerfiles); do
97 if ./run-build-packages-one-target.sh --target "$(basename $(dirname "$dockerfile_path"))" --command "$COMMAND" --build-version "$ARVADOS_BUILDING_VERSION" $DEBUG $TEST_PACKAGES $ONLY_TEST ; then
102 echo "Build packages failed for $(basename $(dirname "$dockerfile_path"))"
107 if test $FINAL_EXITCODE != 0 ; then
109 echo "Build packages failed with code $FINAL_EXITCODE" >&2