Skip to content

Commit f53ffe9

Browse files
Expose test build option for RPM make targets
Building an RPM with test binaries is off by default, but users should be able to turn the option back on if they want. Signed-off-by: Steve Kuznetsov <[email protected]>
1 parent 7366167 commit f53ffe9

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Makefile

+12-3
Original file line numberDiff line numberDiff line change
@@ -237,24 +237,33 @@ install-travis:
237237

238238
# Build RPMs only for the Linux AMD64 target
239239
#
240+
# Args:
241+
# BUILD_TESTS: whether or not to build a test RPM, off by default
242+
#
240243
# Example:
241244
# make build-rpms
242245
build-rpms:
243-
OS_ONLY_BUILD_PLATFORMS='linux/amd64' hack/build-rpm-release.sh
246+
BUILD_TESTS=$(BUILD_TESTS) OS_ONLY_BUILD_PLATFORMS='linux/amd64' hack/build-rpm-release.sh
244247
.PHONY: build-rpms
245248

246249
# Build RPMs for all architectures
247250
#
251+
# Args:
252+
# BUILD_TESTS: whether or not to build a test RPM, off by default
253+
#
248254
# Example:
249255
# make build-rpms-redistributable
250256
build-rpms-redistributable:
251-
hack/build-rpm-release.sh
257+
BUILD_TESTS=$(BUILD_TESTS) hack/build-rpm-release.sh
252258
.PHONY: build-rpms-redistributable
253259

254260
# Build a release of OpenShift using tito for linux/amd64 and the images that depend on it.
255261
#
262+
# Args:
263+
# BUILD_TESTS: whether or not to build a test RPM, off by default
264+
#
256265
# Example:
257-
# make release
266+
# make release-rpms BUILD_TESTS=1
258267
release-rpms: clean build-rpms
259268
hack/build-images.sh
260269
hack/extract-release.sh

hack/build-rpm-release.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# This script generates release zips and RPMs into _output/releases.
44
# tito and other build dependencies are required on the host. We will
55
# be running `hack/build-cross.sh` under the covers, so we transitively
6-
# consume all of the relevant envars.
6+
# consume all of the relevant envars. We also consume:
7+
# - BUILD_TESTS: whether or not to build a test RPM, off by default
78
source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
89
os::build::setup_env
910
os::util::environment::setup_tmpdir_vars "build-rpm-release"
@@ -20,7 +21,7 @@ os::log::info 'Building Origin release RPMs with tito...'
2021
tito_tmp_dir="${BASETMPDIR}/tito"
2122
mkdir -p "${tito_tmp_dir}"
2223
tito build --output="${tito_tmp_dir}" --rpm --test --no-cleanup \
23-
--rpmbuild-options="--define 'make_redistributable ${make_redistributable}'"
24+
--rpmbuild-options="--define 'make_redistributable ${make_redistributable}' --define 'build_tests ${BUILD_TESTS:-0}'"
2425

2526
os::log::info 'Unpacking tito artifacts for reuse...'
2627
output_directories=( $( find "${tito_tmp_dir}" -type d -name 'rpmbuild-origin*' ) )

0 commit comments

Comments
 (0)