jenkins: restrict the number of parallel jobs
authorJustus Winter <justus@g10code.com>
Wed, 21 Jun 2017 14:34:00 +0000 (16:34 +0200)
committerJustus Winter <justus@g10code.com>
Wed, 21 Jun 2017 14:34:00 +0000 (16:34 +0200)
misc/jenkins/bin/build.bash

index 2390fb6..af492c1 100755 (executable)
@@ -7,6 +7,7 @@ renice -n 10 -p $$
 
 # Configuration.
 MAKE=make
+NPROCS=2
 
 XTARGET="${XTARGET:-native}"
 
@@ -15,6 +16,9 @@ case "$(uname)" in
     OpenBSD)
        MAKE=gmake
        ;;
+    Darwin)
+       NPROCS="$(sysctl -n hw.ncpu)"
+       ;;
 esac
 
 if [ "$XTARGET" = w32 ]; then
@@ -81,10 +85,7 @@ git clean -fdx
 ./autogen.sh
 
 # Parallel jobs.
-MAKEFLAGS="-j6"
-
-# Parallel tests with our test suite.
-export TESTFLAGS="--parallel"
+MAKEFLAGS="-j$NPROCS"
 
 SCANBUILD=
 if [ "$(uname)" = Linux ] \
@@ -148,6 +149,9 @@ case "$JOB_NAME" in
 
        # Disable NTBTLS for now until it is actually mature and used.
        CONFIGUREFLAGS="$CONFIGUREFLAGS --disable-ntbtls"
+
+       # Parallel tests with our test suite.
+       export TESTFLAGS="--parallel=$NPROCS"
         ;;
 esac