Mayank Patel 6d3ebf4dc6 Add Node Interface metrics exporter app to StarlingX
This commit contains integration of node interface metrics microservice
,python plugin and custom helm chart for metrics exporter app. As per
requirement node interface metrics pod run on worker node.

This builds a deb format package that contains the .tgz file that can be
installed on the controller using the system application tool.

Test plan:
PASSED: Build process is successful with creation of debian package.
PASSED: Extract the content of the debian package and check if the helm
chart tar file is present.
PASSED: AIO-SX app successfully uploaded, applied, removed and deleted
        using the 'system application' commands.
PASSED: AIO-DX app successfully uploaded, applied, removed and deleted
        using the 'system application' commands.
PASSED: STANDARD app successfully uploaded, applied, removed and deleted
        using the 'system application' commands. Verified pods are
        running on compute node only.
PASSED: After delete All  the helm chart has been removed as well all
        K8s resources.
PASSED: Update application version from 1.0-1 to 1.0-2

Story: 2010918
Task: 48885
Change-Id: I93d7494b04be16c808a6ad6af115659f8298ee10
Signed-off-by: Mayank Patel <mayank.patel@windriver.com>
2023-12-04 15:49:18 +00:00

58 lines
1.7 KiB
Makefile
Executable File

#!/usr/bin/make -f
# export DH_VERBOSE = 1
export ROOT = debian/tmp
export APP_FOLDER = $(ROOT)/usr/local/share/applications/helm
export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
export RELEASE = $(shell echo $(DEB_VERSION) | cut -f 1 -d '-')
export REVISION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.')
export APP_NAME = node-interface-metrics-exporter
export APP_VERSION = $(RELEASE)-$(REVISION)
export APP_TARBALL_FLUXCD = $(APP_NAME)-$(APP_VERSION).tgz
export HELM_FOLDER = /usr/lib/helm
export HELM_REPO = stx-platform
export STAGING = staging
%:
dh $@
override_dh_auto_build:
# Create the helm-chart TGZ file.
cd helm-charts && make
# Setup the staging directory.
mkdir -p $(STAGING)
cp files/metadata.yaml $(STAGING)
cp -Rv fluxcd-manifests/ $(STAGING)
mkdir -p $(STAGING)/charts
cp helm-charts/*.tgz $(STAGING)/charts
# Populate metadata.
sed -i 's/@APP_NAME@/$(APP_NAME)/g' $(STAGING)/metadata.yaml
sed -i 's/@APP_VERSION@/$(APP_VERSION)/g' $(STAGING)/metadata.yaml
sed -i 's/@HELM_REPO@/$(HELM_REPO)/g' $(STAGING)/metadata.yaml
# Copy the plugins: installed in the buildroot
mkdir -p $(STAGING)/plugins
cp /plugins/*.whl $(STAGING)/plugins
# Prepare staging for fluxcd package
cp -R fluxcd-manifests $(STAGING)/
# Create the app package.
cd $(STAGING) && find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
tar cfz $(APP_TARBALL_FLUXCD) -C $(STAGING)/ .
# Cleanup staging
rm -rf $(STAGING)
override_dh_auto_install:
# Install the app tar file.
install -d -m 755 $(APP_FOLDER)
install -p -D -m 755 $(APP_TARBALL_FLUXCD) $(APP_FOLDER)
override_dh_auto_test:
override_dh_usrlocal: