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)
21 WORKSPACE=path Path to the Arvados source tree to build packages from
25 if ! [[ -n "$WORKSPACE" ]]; then
26 echo >&2 "$helpmessage"
28 echo >&2 "Error: WORKSPACE environment variable not set"
33 if ! [[ -d "$WORKSPACE" ]]; then
34 echo >&2 "$helpmessage"
36 echo >&2 "Error: $WORKSPACE is not a directory"
43 PARSEDOPTS=$(getopt --name "$0" --longoptions \
44 help,test-packages,debug,command:,only-test: \
55 eval set -- "$PARSEDOPTS"
56 while [ $# -gt 0 ]; do
59 echo >&2 "$helpmessage"
70 TEST_PACKAGES="--test-packages"
73 ONLY_TEST="$1 $2"; shift
77 echo >&2 "$0: unrecognized argument '$2'. Try: $0 --help"
89 for dockerfile_path in $(find -name Dockerfile | grep package-build-dockerfiles); do
90 if ./run-build-packages-one-target.sh --target "$(basename $(dirname "$dockerfile_path"))" --command "$COMMAND" $DEBUG $TEST_PACKAGES $ONLY_TEST ; then
97 if test $FINAL_EXITCODE != 0 ; then
98 echo "Build packages failed with code $FINAL_EXITCODE" >&2