Less verbose by default
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 30 Dec 2016 17:47:42 +0000 (18:47 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 30 Dec 2016 17:47:42 +0000 (18:47 +0100)
id-deb-build/docker-build.sh

index ce331a6..780bcfc 100755 (executable)
@@ -6,11 +6,11 @@ Usage: docker-build.sh [OPTIONS]
 Options:
         [--debian=distros]
         [--ubuntu=distros]
+        [--verbose]
         [--upload]
 EOF
     exit $1
 }
-set -x
 D0=`dirname $0`
 ID_DEB_BUILD=`cd $D0; pwd`
 
@@ -32,12 +32,12 @@ while test $# -gt 0; do
         --centos=*)
             CENTOS_DIST_A=$optarg
             ;;
-        --concurrency=*)
-            concurrency=$optarg
-            ;;
         --upload)
             upload=true
             ;;
+        --verbose)
+           set -x
+            ;;
         -*)
             do_help=yes
             ;;
@@ -204,6 +204,7 @@ fi
 
 if test "${CENTOS_DIST}"; then
     for dist in ${CENTOS_DIST}; do
+       echo -n "$dist "
        case $dist in
            centos6)
                D=6;;
@@ -214,21 +215,38 @@ if test "${CENTOS_DIST}"; then
                exit 1
        esac
        cd build/centos/$dist
-       docker run -it --rm  -v "$PWD:/build" -w /build/rpmbuild centos:$D ../in-docker-rpm.sh centos $D
+       docker run --rm  -v "$PWD:/build" -w /build/rpmbuild centos:$D ../in-docker-rpm.sh centos $D >log 2>&1
+       if test $? -eq 0; then
+               echo Done
+       else
+               echo "Fail. Inspect build/centos/$dist/log"
+       fi
        cd ../../..
     done
 fi
 if test "${DEBIAN_DIST}"; then
     for dist in ${DEBIAN_DIST}; do
+       echo -n "Debian $dist "
        cd build/debian/$dist
-       docker run -it --rm  -v "$PWD:/build" -w /build/$PRODUCT-$VERSION debian:$dist ../in-docker.sh debian $dist
+       docker run --rm  -v "$PWD:/build" -w /build/$PRODUCT-$VERSION debian:$dist ../in-docker.sh debian $dist >log 2>&1
+       if test $? -eq 0; then
+               echo Done
+       else
+               echo "Fail. Inspect build/debian/$dist/log"
+       fi
        cd ../../..
     done
 fi
 if test "${UBUNTU_DIST}"; then
     for dist in ${UBUNTU_DIST}; do
+       echo -n "Ubuntu $dist"
        cd build/ubuntu/$dist
-       docker run -it --rm  -v "$PWD:/build" -w /build/$PRODUCT-$VERSION ubuntu:$dist ../in-docker.sh ubuntu $dist
+       docker run --rm  -v "$PWD:/build" -w /build/$PRODUCT-$VERSION ubuntu:$dist ../in-docker.sh ubuntu $dist >log 2>&1
+       if test $? -eq 0; then
+               echo Done
+       else
+               echo "Fail. Inspect build/ubuntu/$dist/log"
+       fi
        cd ../../..
     done
 fi