17417: add --only-build flag to the
[arvados.git] / build / run-build-test-packages-one-target.sh
index 1c8296dfca354f2feb2fb577d1aece345e82cbef..2e2e3cdb4078069f9eb1408f1d927ba8c117ed56 100755 (executable)
@@ -11,6 +11,8 @@ Syntax:
 
 --target <target>
     Distribution to build packages for (default: debian10)
+--only-build <package>
+    Build only a specific package (or $ONLY_BUILD from environment)
 --upload
     If the build and test steps are successful, upload the packages
     to a remote apt repository (default: false)
@@ -44,7 +46,7 @@ if ! [[ -d "$WORKSPACE" ]]; then
 fi
 
 PARSEDOPTS=$(getopt --name "$0" --longoptions \
-    help,debug,upload,rc,target:,build-version: \
+    help,debug,upload,rc,target:,only-build:,build-version: \
     -- "" "$@")
 if [ $? -ne 0 ]; then
     exit 1
@@ -68,6 +70,9 @@ while [ $# -gt 0 ]; do
         --target)
             TARGET="$2"; shift
             ;;
+        --only-build)
+            ONLY_BUILD="$2"; shift
+            ;;
         --debug)
             DEBUG=" --debug"
             ;;
@@ -93,6 +98,10 @@ done
 
 build_args+=(--target "$TARGET")
 
+if [[ -n "$ONLY_BUILD" ]]; then
+  build_args+=(--only-build "$ONLY_BUILD")
+fi
+
 exit_cleanly() {
     trap - INT
     report_outcomes