|
84 | 84 | BUILD_S3SELECT?=1
|
85 | 85 | BUILD_S3SELECT_PARQUET?=0
|
86 | 86 |
|
| 87 | +## RPM VARIABLES |
| 88 | +DATE := $(shell date +'%Y%m%d') |
| 89 | +NOOBAA_PKG_VERSION := $(shell jq -r '.version' < ./package.json) |
| 90 | +RPM_BASE_VERSION := noobaa-core-$(NOOBAA_PKG_VERSION)-${DATE} |
| 91 | +ifeq ($(CONTAINER_PLATFORM), linux/amd64) |
| 92 | + ARCH_SUFFIX := x86_64 |
| 93 | +else ifeq ($(CONTAINER_PLATFORM), linux/ppc64le) |
| 94 | + ARCH_SUFFIX := ppc64le |
| 95 | +endif |
| 96 | +RPM_FULL_PATH := $(RPM_BASE_VERSION).el${CENTOS_VER}.$(ARCH_SUFFIX).rpm |
| 97 | +install_rpm_and_deps_command := dnf install -y make && rpm -i $(RPM_FULL_PATH) && systemctl enable noobaa --now && systemctl status noobaa && systemctl stop noobaa |
| 98 | + |
87 | 99 | ###############
|
88 | 100 | # BUILD LOCAL #
|
89 | 101 | ###############
|
@@ -178,6 +190,22 @@ rpm: builder
|
178 | 190 | echo "\033[1;32mRPM for platform \"$(NOOBAA_RPM_TAG)\" is ready in build/rpm.\033[0m";
|
179 | 191 | .PHONY: rpm
|
180 | 192 |
|
| 193 | +assert-rpm-build-and-install-test-platform: |
| 194 | + @ if [ "${CONTAINER_PLATFORM}" != "linux/amd64" ]; then \ |
| 195 | + echo "\n Error: Running rpm-build-and-install-test linux/amd64 is currently the only supported container platform\n"; \ |
| 196 | + exit 1; \ |
| 197 | + fi |
| 198 | +.PHONY: assert-rpm-build-and-install-test-platform |
| 199 | + |
| 200 | +rpm-build-and-install-test: assert-rpm-build-and-install-test-platform rpm |
| 201 | + @echo "Running RHEL linux/amd64 (currently only supported) container..." |
| 202 | + $(CONTAINER_ENGINE) run --name noobaa-rpm-build-and-install-test --privileged --user root -dit --platform=linux/amd64 redhat/ubi$(CENTOS_VER)-init |
| 203 | + @echo "Copying rpm_full_path=$(RPM_FULL_PATH) to the container..." |
| 204 | + $(CONTAINER_ENGINE) cp ./build/rpm/$(RPM_FULL_PATH) noobaa-rpm-build-and-install-test:$(RPM_FULL_PATH) |
| 205 | + @echo "Installing RPM and dependencies in the container... $(install_rpm_and_deps_command)" |
| 206 | + $(CONTAINER_ENGINE) exec noobaa-rpm-build-and-install-test bash -c "$(install_rpm_and_deps_command)" |
| 207 | +.PHONY: rpm-build-and-install-test |
| 208 | + |
181 | 209 | ###############
|
182 | 210 | # TEST IMAGES #
|
183 | 211 | ###############
|
|
0 commit comments