12268: Remove libcloud fork installation attempt on run-tests.sh
[arvados.git] / build / run-build-packages-one-target.sh
index f2e514736b2cf9d4846e7ffaaf33ca625b94ad07..c981b2a9ef679509bb24f7ecd25d005fb9d50920 100755 (executable)
@@ -22,7 +22,9 @@ Syntax:
 --only-test <package>
     Test only a specific package
 --build-version <string>
-    Version to build (default: \$ARVADOS_BUILDING_VERSION or 0.1.timestamp.commithash)
+    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
 
@@ -86,12 +88,15 @@ while [ $# -gt 0 ]; do
             test_packages=1
             ;;
         --build-version)
-            if ! [[ "$2" =~ (.*)-(.*) ]]; then
+            if [[ -z "$2" ]]; then
+                :
+            elif ! [[ "$2" =~ (.*)-(.*) ]]; then
                 echo >&2 "FATAL: --build-version '$2' does not include an iteration. Try '${2}-1'?"
                 exit 1
+            else
+                ARVADOS_BUILDING_VERSION="${BASH_REMATCH[1]}"
+                ARVADOS_BUILDING_ITERATION="${BASH_REMATCH[2]}"
             fi
-            ARVADOS_BUILDING_VERSION="${BASH_REMATCH[1]}"
-            ARVADOS_BUILDING_ITERATION="${BASH_REMATCH[2]}"
             shift
             ;;
         --)
@@ -106,10 +111,21 @@ done
 
 set -e
 
-echo "build version='$ARVADOS_BUILDING_VERSION', package iteration='$ARVADOS_BUILDING_ITERATION'"
+if [[ -n "$ARVADOS_BUILDING_VERSION" ]]; then
+    echo "build version='$ARVADOS_BUILDING_VERSION', package iteration='$ARVADOS_BUILDING_ITERATION'"
+fi
 
 if [[ -n "$test_packages" ]]; then
     if [[ -n "$(find $WORKSPACE/packages/$TARGET -name '*.rpm')" ]] ; then
+       set +e
+       /usr/bin/which createrepo >/dev/null
+       if [[ "$?" != "0" ]]; then
+               echo >&2
+               echo >&2 "Error: please install createrepo. E.g. sudo apt-get install createrepo"
+               echo >&2
+               exit 1
+       fi
+       set -e
         createrepo $WORKSPACE/packages/$TARGET
     fi
 
@@ -145,6 +161,7 @@ popd
 
 if test -z "$packages" ; then
     packages="arvados-api-server
+        arvados-client
         arvados-docker-cleaner
         arvados-git-httpd
         arvados-node-manager
@@ -160,14 +177,10 @@ if test -z "$packages" ; then
         keep-rsync
         keepstore
         keep-web
-        libarvados-perl"
-
-    case "$TARGET" in
-        *)
-            packages="$packages python-arvados-fuse
-                  python-arvados-python-client python-arvados-cwl-runner"
-            ;;
-    esac
+        libarvados-perl
+        python-arvados-fuse
+        python-arvados-python-client
+        python-arvados-cwl-runner"
 fi
 
 FINAL_EXITCODE=0