19146: Remove unneeded special case checks, explain the needed one.
[arvados.git] / build / run-build-packages-all-targets.sh
index f1a1e1c4b3fa76eb5173109f071ee5b19f39b0b7..85c498ecd5e55f98b079af1477852e967ebc851e 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/bash
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
 
 read -rd "\000" helpmessage <<EOF
 $(basename $0): Orchestrate run-build-packages.sh for every target
@@ -14,6 +17,10 @@ Options:
     Run package install tests
 --debug
     Output debug information (default: false)
+--build-version <string>
+    Version to build (default:
+    \$ARVADOS_BUILDING_VERSION-\$ARVADOS_BUILDING_ITERATION or
+    0.1.timestamp.commithash)
 
 WORKSPACE=path         Path to the Arvados source tree to build packages from
 
@@ -38,7 +45,7 @@ fi
 set -e
 
 PARSEDOPTS=$(getopt --name "$0" --longoptions \
-    help,test-packages,debug,command:,only-test: \
+    help,test-packages,debug,command:,only-test:,build-version: \
     -- "" "$@")
 if [ $? -ne 0 ]; then
     exit 1
@@ -69,6 +76,9 @@ while [ $# -gt 0 ]; do
         --only-test)
             ONLY_TEST="$1 $2"; shift
             ;;
+        --build-version)
+            ARVADOS_BUILDING_VERSION="$2"; shift
+            ;;
         --)
             if [ $# -gt 1 ]; then
                 echo >&2 "$0: unrecognized argument '$2'. Try: $0 --help"
@@ -83,16 +93,21 @@ cd $(dirname $0)
 
 FINAL_EXITCODE=0
 
-for dockerfile_path in $(find -name Dockerfile); do
-    if ./run-build-packages-one-target.sh --target "$(basename $(dirname "$dockerfile_path"))" --command "$COMMAND" $DEBUG $TEST_PACKAGES $ONLY_TEST ; then
+for dockerfile_path in $(find -name Dockerfile | grep package-build-dockerfiles); do
+    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
         true
     else
         FINAL_EXITCODE=$?
+        echo
+        echo "Build packages failed for $(basename $(dirname "$dockerfile_path"))"
+        echo
     fi
 done
 
 if test $FINAL_EXITCODE != 0 ; then
+    echo
     echo "Build packages failed with code $FINAL_EXITCODE" >&2
+    echo
 fi
 
 exit $FINAL_EXITCODE