8008: Run bundle install and bundle list for api server and workbench.
[arvados.git] / jenkins / run-build-packages-one-target.sh
index 3e0e13670fc419cffd89af87ecc90c966668bc22..ad4645267b663ba964d70933b35928d5b74498cd 100755 (executable)
@@ -12,6 +12,10 @@ Syntax:
     Build command to execute (default: use built-in Docker image command)
 --test-packages
     Run package install test script "test-packages-$target.sh"
+--debug
+    Output debug information (default: false)
+--only-test
+    Test only a specific package
 
 WORKSPACE=path         Path to the Arvados source tree to build packages from
 
@@ -34,7 +38,7 @@ if ! [[ -d "$WORKSPACE" ]]; then
 fi
 
 PARSEDOPTS=$(getopt --name "$0" --longoptions \
-    help,test-packages,target:,command: \
+    help,debug,test-packages,target:,command:,only-test: \
     -- "" "$@")
 if [ $? -ne 0 ]; then
     exit 1
@@ -42,6 +46,7 @@ fi
 
 TARGET=debian7
 COMMAND=
+DEBUG=
 
 eval set -- "$PARSEDOPTS"
 while [ $# -gt 0 ]; do
@@ -54,6 +59,12 @@ while [ $# -gt 0 ]; do
         --target)
             TARGET="$2"; shift
             ;;
+        --only-test)
+            packages="$2"; shift
+            ;;
+        --debug)
+            DEBUG=" --debug"
+            ;;
         --command)
             COMMAND="$2"; shift
             ;;
@@ -79,7 +90,7 @@ if [[ -n "$test_packages" ]]; then
 
     if [[ -n "$(find $WORKSPACE/packages/$TARGET -name *.deb)" ]] ; then
         (cd $WORKSPACE/packages/$TARGET
-         dpkg-scanpackages . /dev/null | gzip -c > Packages.gz
+         dpkg-scanpackages .  2> >(grep -v 'warning' 1>&2) | gzip -c > Packages.gz
         )
     fi
 
@@ -88,7 +99,7 @@ if [[ -n "$test_packages" ]]; then
 else
     IMAGE="arvados/build:$TARGET"
     if [[ "$COMMAND" != "" ]]; then
-        COMMAND="/usr/local/rvm/bin/rvm-exec default bash /jenkins/$COMMAND --target $TARGET"
+        COMMAND="/usr/local/rvm/bin/rvm-exec default bash /jenkins/$COMMAND --target $TARGET$DEBUG"
     fi
 fi
 
@@ -105,15 +116,56 @@ cd $TARGET
 time docker build --tag=$IMAGE .
 popd
 
+if test -z "$packages" ; then
+    packages="arvados-api-server
+        arvados-data-manager
+        arvados-docker-cleaner
+        arvados-git-httpd
+        arvados-node-manager
+        arvados-src
+        arvados-workbench
+        crunchstat
+        keepproxy
+        keep-rsync
+        keepstore
+        keep-web
+        libarvados-perl"
+
+    if test $target == centos6 ; then
+        packages="$packages python27-python-arvados-fuse
+                  python27-python-arvados-python-client"
+    else
+        packages="$packages python-arvados-fuse
+                  python-arvados-python-client"
+    fi
+fi
+
 FINAL_EXITCODE=0
 
-if docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
-          --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND; then
-    # Success - nothing more to do.
-    true
+package_fails=""
+
+if [[ -n "$test_packages" ]]; then
+    for p in $packages ; do
+        if ! docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
+                  --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND $p ; then
+            FINAL_EXITCODE=$?
+            package_fails="$package_fails $p"
+            echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
+        fi
+    done
 else
-    FINAL_EXITCODE=$?
-    echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
+    if docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
+              --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND; then
+        # Success - nothing more to do.
+        true
+    else
+        FINAL_EXITCODE=$?
+        echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
+    fi
+fi
+
+if test -n "$package_fails" ; then
+    echo "Failed package tests:$package_fails"
 fi
 
 exit $FINAL_EXITCODE