18766: add --force-test and --force-build options to the
authorWard Vandewege <ward@curii.com>
Mon, 7 Mar 2022 17:31:45 +0000 (12:31 -0500)
committerWard Vandewege <ward@curii.com>
Mon, 7 Mar 2022 17:31:45 +0000 (12:31 -0500)
       run-build-test-packages-one-target.sh script.

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward@curii.com>

build/run-build-test-packages-one-target.sh

index e36c4e88c0d0bf146ac88a9d12587ef03b9a960e..aa4acb6a2bf7817f933f9bdb85b74789c91b154b 100755 (executable)
@@ -15,6 +15,11 @@ Syntax:
     Build only a specific package (or ONLY_BUILD from environment)
 --arch <arch>
     Build a specific architecture (or ARCH from environment, defaults to native architecture)
+--force-build
+    Build even if the package exists upstream or if it has already been
+    built locally
+--force-test
+    Test even if there is no new untested package
 --upload
     If the build and test steps are successful, upload the packages
     to a remote apt repository (default: false)
@@ -48,7 +53,7 @@ if ! [[ -d "$WORKSPACE" ]]; then
 fi
 
 PARSEDOPTS=$(getopt --name "$0" --longoptions \
-    help,debug,upload,rc,target:,only-build:,arch:,build-version: \
+    help,debug,upload,rc,target:,force-test,only-build:,force-build,arch:,build-version: \
     -- "" "$@")
 if [ $? -ne 0 ]; then
     exit 1
@@ -72,6 +77,12 @@ while [ $# -gt 0 ]; do
         --target)
             TARGET="$2"; shift
             ;;
+        --force-test)
+            FORCE_TEST=1
+            ;;
+        --force-build)
+            FORCE_BUILD=1
+            ;;
         --only-build)
             ONLY_BUILD="$2"; shift
             ;;
@@ -107,6 +118,14 @@ if [[ -n "$ONLY_BUILD" ]]; then
   build_args+=(--only-build "$ONLY_BUILD")
 fi
 
+if [[ -n "$FORCE_BUILD" ]]; then
+  build_args+=(--force-build)
+fi
+
+if [[ -n "$FORCE_TEST" ]]; then
+  build_args+=(--force-test)
+fi
+
 if [[ -n "$ARCH" ]]; then
   build_args+=(--arch "$ARCH")
 fi