diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh index 44aa978..09fcf0a 100755 --- a/scripts/build-packages.sh +++ b/scripts/build-packages.sh @@ -15,6 +15,7 @@ declare_env BUILD_PACKAGES_LIST require_env BUILD_RT require_env CLEAN_PACKAGES require_env BUILD_ISO +declare_env BUILD_PACKAGES_PARALLEL_JOBS load_build_env @@ -30,6 +31,11 @@ if $BUILD_RT || $BUILD_ISO; then build_types+=",rt" fi +declare -a parallel_args +if [[ -n "$BUILD_PACKAGES_PARALLEL_JOBS" && "$BUILD_PACKAGES_PARALLEL_JOBS" -gt 1 ]] ; then + parallel_args=("--parallel" "$BUILD_PACKAGES_PARALLEL_JOBS") +fi + count=0 success=0 # Build all packages a few times @@ -51,7 +57,7 @@ while [[ $count -lt $BUILD_PACKAGES_ITERATIONS ]] ; do fi # buld'em - if stx_docker_cmd $DRY_RUN_ARG $VEBOSE_ARG "build-pkgs ${extra_args[*]} -b $build_types" ; then + if stx_docker_cmd $DRY_RUN_ARG $VEBOSE_ARG "build-pkgs ${parallel_args[*]} ${extra_args[*]} -b $build_types" ; then success=1 else success=0 diff --git a/scripts/templates/build.conf.example.in b/scripts/templates/build.conf.example.in index f5aa3d2..ad2443e 100644 --- a/scripts/templates/build.conf.example.in +++ b/scripts/templates/build.conf.example.in @@ -154,3 +154,7 @@ JENKINS_API_CREDENTIALS_ID="jenkins-api" # Makes some operations faster PARALLEL_CMD="parallel" PARALLEL_CMD_JOBS="12" + +# How many chroots & build-pkgs jobs to run in parallel +# Default: 1 +#BUILD_PACKAGES_PARALLEL_JOBS=