From 710eecbee9a09e013f56560d38ba12a318a17baa Mon Sep 17 00:00:00 2001 From: Casey Langen Date: Wed, 24 Feb 2021 14:33:17 -0800 Subject: [PATCH] Build script updates so RPMs honor JOB_COUNT --- .circleci/config.yml | 6 +++--- script/run-circle-ci.sh | 1 + script/run-rpm-build.sh | 11 +++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 script/run-rpm-build.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index aa175c8e2..983b53263 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,7 +50,7 @@ jobs: - checkout - run: dnf builddep -y musikcube.spec - run: mkdir -p /root/rpmbuild/SOURCES && spectool -g -R musikcube.spec - - run: rpmbuild -ba -vv musikcube.spec + - run: ./script/run-rpm-build.sh - run: ./script/copy-artifacts-to-host.sh /root/rpmbuild/RPMS/x86_64/*.rpm - run: mkdir -p /root/rpms && mv /root/rpmbuild/RPMS/x86_64/*.rpm /root/rpms/ - store_artifacts: @@ -63,7 +63,7 @@ jobs: - checkout - run: dnf builddep -y musikcube.spec - run: mkdir -p /root/rpmbuild/SOURCES && spectool -g -R musikcube.spec - - run: rpmbuild -ba -vv musikcube.spec + - run: ./script/run-rpm-build.sh - run: ./script/copy-artifacts-to-host.sh /root/rpmbuild/RPMS/x86_64/*.rpm - run: mkdir -p /root/rpms && mv /root/rpmbuild/RPMS/x86_64/*.rpm /root/rpms/ - store_artifacts: @@ -76,7 +76,7 @@ jobs: - checkout - run: dnf builddep -y musikcube.spec - run: mkdir -p /root/rpmbuild/SOURCES && spectool -g -R musikcube.spec - - run: rpmbuild -ba -vv musikcube.spec + - run: ./script/run-rpm-build.sh - run: ./script/copy-artifacts-to-host.sh /root/rpmbuild/RPMS/x86_64/*.rpm - run: mkdir -p /root/rpms && mv /root/rpmbuild/RPMS/x86_64/*.rpm /root/rpms/ - store_artifacts: diff --git a/script/run-circle-ci.sh b/script/run-circle-ci.sh index 389835c9b..38e1080f8 100755 --- a/script/run-circle-ci.sh +++ b/script/run-circle-ci.sh @@ -53,6 +53,7 @@ for JOB in ${ALL_JOBS[@]}; do -e MUSIKCUBE_BUILD_HOST_IP=${IP} \ -e MUSIKCUBE_BUILD_HOST_PORT=${PORT} \ -e MUSIKCUBE_BUILD_HOST_PW=${PW} \ + -e MUSIKCUBE_BUILD_JOB_COUNT=${JOB_COUNT} \ --job ${JOB} done diff --git a/script/run-rpm-build.sh b/script/run-rpm-build.sh new file mode 100755 index 000000000..c8f4d79de --- /dev/null +++ b/script/run-rpm-build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +JOB_COUNT=${MUSIKCUBE_BUILD_JOB_COUNT} +if [[ -z "${JOB_COUNT}" ]]; then + JOB_COUNT=2 +fi + +echo "configuring rpm with ${JOB_COUNT} jobs" +sed -i "s/-j2/-j${JOB_COUNT}/g" musikcube.spec +rpmbuild -ba -vv musikcube.spec +