73 lines
2.8 KiB
Makefile
73 lines
2.8 KiB
Makefile
# compile dir
|
|
#./build/x86_64_COTS/app-bundle/
|
|
# /installer
|
|
# /cook-bits
|
|
|
|
# app bin dir
|
|
#./installer
|
|
# install.sh
|
|
# /helmcharts/*.tgz
|
|
# /images/*.tar
|
|
# /manifests/*.yaml
|
|
|
|
PROFILE_ID := x86_64_COTS
|
|
PROFILE_ID_IN_SHORT := $(subst -,$e,$(PROFILE_ID))
|
|
|
|
TARGET_BUILD_DIR := $(BUILDDIR_BASE)/$(PROFILE_ID)/app-bundle
|
|
TARGET_INSTALLER_DIR := $(TARGET_BUILD_DIR)/installer
|
|
TARGET_MANIFESTS_DIR := $(TARGET_INSTALLER_DIR)/manifests
|
|
TARGET_HELMCHARTS_DIR := $(TARGET_INSTALLER_DIR)/helmcharts
|
|
TARGET_IMAGES_DIR := $(TARGET_INSTALLER_DIR)/images
|
|
|
|
COOK_BITS_DIR := $(TARGET_BUILD_DIR)/cook-bits
|
|
|
|
APP_BUNDLE_BIN := tsg-os-$(OS_RELEASE_VER)-$(PROFILE_ID_IN_SHORT)-APP-BUNDLE.bin
|
|
|
|
ifeq ($(ENABLE_ALIYUN_INTERNAL_DOMAIN),1)
|
|
$(shell sed -i -e "s/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/" $(CONFDIR)/yum-RockyLinux-8.conf)
|
|
endif
|
|
|
|
.PHONY: all build-app-bundle-bin install-scripts build-container-images build-helmcharts
|
|
|
|
all: build-app-bundle-bin
|
|
|
|
build-app-bundle-bin: install-scripts build-container-images build-helmcharts
|
|
mkdir -p $(COOK_BITS_DIR)
|
|
chmod 0755 $(TOOLSDIR)/app-bundle-cook-bits; \
|
|
$(TOOLSDIR)/app-bundle-cook-bits $(TARGET_BUILD_DIR) $(COOK_BITS_DIR) $(IMAGEDIR_BASE)/$(APP_BUNDLE_BIN)
|
|
sha256sum $(IMAGEDIR_BASE)/$(APP_BUNDLE_BIN) | awk '{print $$1}' > $(IMAGEDIR_BASE)/$(APP_BUNDLE_BIN).sha256sum.txt
|
|
|
|
install-scripts:
|
|
mkdir -p $(TARGET_INSTALLER_DIR)
|
|
|
|
cp $(INSTALLERDIR)/app_bundle_install.sh $(TARGET_INSTALLER_DIR)/install.sh
|
|
chmod +x $(TARGET_INSTALLER_DIR)/install.sh
|
|
|
|
sed -i -e "s/%%TRAFFIC_ENGINE_HELM_CHART_TAR%%/traffic-engine-$(HELM_CHART_VER).tgz/" $(TARGET_INSTALLER_DIR)/install.sh
|
|
sed -i -e "s/%%INJECT_HELM_CHART_TAR%%/inject-adapter-$(HELM_CHART_VER).tgz/" $(TARGET_INSTALLER_DIR)/install.sh
|
|
sed -i -e "s/%%MRZCPD_HELM_CHART_TAR%%/mrzcpd-$(HELM_CHART_VER).tgz/" $(TARGET_INSTALLER_DIR)/install.sh
|
|
sed -i -e "s/%%TREX_HELM_CHART_TAR%%/trex-$(HELM_CHART_VER).tgz/" $(TARGET_INSTALLER_DIR)/install.sh
|
|
sed -i -e "s/%%DP_TRACE_HELM_CHART_TAR%%/datapath-trace-$(HELM_CHART_VER).tgz/" $(TARGET_INSTALLER_DIR)/install.sh
|
|
sed -i -e "s/%%TSG_CM_HELM_CHART_TAR%%/tsg-cm-chart-0.1.0.tgz/" $(TARGET_INSTALLER_DIR)/install.sh
|
|
|
|
build-container-images:
|
|
mkdir -p $(TARGET_IMAGES_DIR)
|
|
$(MAKE) -j -C $(PROJECTDIR)/containers \
|
|
IMAGE_TAG=$(OS_RELEASE_VER) \
|
|
YUM_REPO_FILE=$(CONFDIR)/yum-RockyLinux-8.conf \
|
|
tsg-os tsg-cm
|
|
cp -af $(PROJECTDIR)/containers/build/images/*.tar $(TARGET_IMAGES_DIR)
|
|
|
|
build-helmcharts:
|
|
mkdir -p $(TARGET_HELMCHARTS_DIR)
|
|
mkdir -p $(TARGET_MANIFESTS_DIR)
|
|
$(MAKE) -j -C $(PROJECTDIR)/helmcharts \
|
|
VERSION=$(HELM_CHART_VER) \
|
|
APP_VERSION=$(OS_RELEASE_VER) \
|
|
tsg-os tsg-cm
|
|
cp -af $(PROJECTDIR)/helmcharts/build/helmcharts/*.tgz $(TARGET_HELMCHARTS_DIR)
|
|
cp -af $(PROJECTDIR)/helmcharts/build/manifests/*.yaml $(TARGET_MANIFESTS_DIR)
|
|
|
|
clean:
|
|
rm -rf $(TARGET_BUILD_DIR)
|