You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2023/01/18 23:56:44 UTC

[trafficcontrol] branch master updated: Wrap architecture-getting command in Makefile in Docker command (#7279)

This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 6bc4cba990 Wrap architecture-getting command in Makefile in Docker command (#7279)
6bc4cba990 is described below

commit 6bc4cba9902d45c37b5811f53df15c71868514a4
Author: Zach Hoffman <zr...@apache.org>
AuthorDate: Wed Jan 18 16:56:37 2023 -0700

    Wrap architecture-getting command in Makefile in Docker command (#7279)
---
 infrastructure/cdn-in-a-box/Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/infrastructure/cdn-in-a-box/Makefile b/infrastructure/cdn-in-a-box/Makefile
index 866adf2981..e91a3a0231 100644
--- a/infrastructure/cdn-in-a-box/Makefile
+++ b/infrastructure/cdn-in-a-box/Makefile
@@ -27,6 +27,12 @@ else
 	RHEL_VERSION := $(shell echo $(RHEL_VERSION) | cut -f1 -d.)
 endif
 
+ifeq ($(shell echo $(RHEL_VERSION) | grep -Eo '^[0-9]+'),7)
+	export BASE_IMAGE := centos
+else
+	BASE_IMAGE := rockylinux
+endif
+
 CIAB_DIR_RELATIVE := $(dir $(MAKEFILE_LIST))
 CIAB_DIR_ABSOLUTE := $(shell cd $(CIAB_DIR_RELATIVE) && pwd)
 TC_DIR := $(CIAB_DIR_RELATIVE)../..
@@ -35,7 +41,8 @@ PKG_COMMAND := $(TC_DIR)/pkg
 PKG_FLAGS := -v -$(RHEL_VERSION)
 BUILD_SUFFIX := _build
 BUILD_NUMBER := $(shell git rev-list HEAD 2>/dev/null | wc -l | tr -d '[[:space:]]').$(shell git rev-parse --short=8 HEAD)
-BUILD_ARCH   := $(shell rpm --eval %_arch)
+# no --rm on the docker command to speed up reuse for shell completion
+BUILD_ARCH   := $(shell docker run --name=ciab-get-$(BASE_IMAGE)-$(RHEL_VERSION)-arch $(BASE_IMAGE):$(RHEL_VERSION) rpm --eval %_arch)
 TC_VERSION := $(shell cat "$(TC_DIR)/VERSION")
 TOMCAT_VERSION := $(shell grep '^\s*TOMCAT_VERSION=' "$(TC_DIR)/traffic_router/build/build_rpm.sh"  | cut -d= -f2)
 TOMCAT_RELEASE := $(shell grep '^\s*TOMCAT_RELEASE=' "$(TC_DIR)/traffic_router/build/build_rpm.sh"  | cut -d= -f2)