cleans up debian/changelog generation per tomclegg's comment
[arvados.git] / jenkins / run-build-packages-one-target.sh
index 23993426c43c0bbcd15174cb6420b38d4eca74a1..95977030fcec0ed01aad02a965c98aa0cac6151a 100755 (executable)
@@ -21,6 +21,8 @@ WORKSPACE=path         Path to the Arvados source tree to build packages from
 
 EOF
 
+set -e
+
 if ! [[ -n "$WORKSPACE" ]]; then
   echo >&2 "$helpmessage"
   echo >&2
@@ -94,7 +96,7 @@ if [[ -n "$test_packages" ]]; then
         )
     fi
 
-    COMMAND="/jenkins/test-packages-$TARGET.sh"
+    COMMAND="/jenkins/package-testing/test-packages-$TARGET.sh"
     IMAGE="arvados/package-test:$TARGET"
 else
     IMAGE="arvados/build:$TARGET"
@@ -108,7 +110,8 @@ JENKINS_DIR=$(dirname "$(readlink -e "$0")")
 if [[ -n "$test_packages" ]]; then
     pushd "$JENKINS_DIR/package-test-dockerfiles"
 else
-    pushd "$JENKINS_DIR/dockerfiles"
+    pushd "$JENKINS_DIR/package-build-dockerfiles"
+    make "$TARGET/generated"
 fi
 
 echo $TARGET
@@ -117,7 +120,7 @@ time docker build --tag=$IMAGE .
 popd
 
 if test -z "$packages" ; then
-packages="arvados-api-server
+    packages="arvados-api-server
         arvados-data-manager
         arvados-docker-cleaner
         arvados-git-httpd
@@ -129,9 +132,18 @@ packages="arvados-api-server
         keep-rsync
         keepstore
         keep-web
-        libarvados-perl
-        python27-python-arvados-fuse
-        python27-python-arvados-python-client"
+        libarvados-perl"
+
+    case "$TARGET" in
+        centos6)
+            packages="$packages python27-python-arvados-fuse
+                  python27-python-arvados-python-client"
+        ;;
+        *)
+            packages="$packages python-arvados-fuse
+                  python-arvados-python-client"
+            ;;
+    esac
 fi
 
 FINAL_EXITCODE=0
@@ -140,18 +152,23 @@ 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
+        if docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
+               --env ARVADOS_DEBUG=1 \
+               --env "TARGET=$TARGET" \
+               --env "WORKSPACE=/arvados" \
+               "$IMAGE" $COMMAND $p ; then
+            true
+        else
             FINAL_EXITCODE=$?
             package_fails="$package_fails $p"
-            echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
+            echo "ERROR: $tag test failed with exit status $FINAL_EXITCODE." >&2
         fi
     done
 else
     if docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
-              --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND; then
-        # Success - nothing more to do.
-        true
+           --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND ; then
+        echo
+        echo "Build packages for $TARGET succeeded." >&2
     else
         FINAL_EXITCODE=$?
         echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
@@ -159,7 +176,7 @@ else
 fi
 
 if test -n "$package_fails" ; then
-    echo "Failed package tests:$package_fails"
+    echo "Failed package tests:$package_fails" >&2
 fi
 
 exit $FINAL_EXITCODE