Hugo Brito 05b7684f3e Create app-distributed-cloud prototype
This commit introduces the prototype for the app-distributed-cloud

All dcmanager services are being containerized, and the app will
utilize Keystone, certmanager, and rabbitmq from the platform.

The prototype is in its initial phase, and DC functionalities/services
have not yet been thoroughly tested. In this first phase, the subcloud
add command is functional.

This commit includes the dcmanager and dc-vault helm charts, and a
a structure of dcorch, that will be added in a following commit.

Before testing the app, the platform must be configured. Refer to the
README file for details.

Test Plan:
PASS: Execute a subcloud add successfully.

Story: 2011312
Task: 51841

Change-Id: Ifa6dbbb39d5bdd48eedd06c732d24d26a48f6ae8
Co-Authored-By: Matt Peters <matt.peters@windriver.com>
Co-Authored-By: Enzo Candotti <enzo.candotti@windriver.com>
Co-Authored-By: Yuxing Jiang <yuxing.jiang@windriver.com>
Signed-off-by: Hugo Brito <hugo.brito@windriver.com>
2025-03-25 15:08:11 -03:00

58 lines
1.6 KiB
Makefile

#!/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 cat /etc/build.info | grep SW_VERSION | cut -d'"' -f2)
export REVISION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.')
export APP_NAME = distributed-cloud
export APP_VERSION = $(RELEASE)-$(REVISION)
export APP_TARBALL = $(APP_NAME)-$(APP_VERSION).tgz
export HELM_REPO = stx-platform
export HELM_FOLDER = /usr/lib/helm
export STAGING = staging
%:
dh $@
override_dh_auto_build:
# Create the TGZ file
cd helm-charts && $(MAKE)
# Setup the staging directory
mkdir -p $(STAGING)
cp files/metadata.yaml $(STAGING)
mkdir -p $(STAGING)/charts
cp helm-charts/*.tgz $(STAGING)/charts
# Populate metadata
sed -i 's/APP_REPLACE_NAME/$(APP_NAME)/g' $(STAGING)/metadata.yaml
sed -i 's/APP_REPLACE_VERSION/$(APP_VERSION)/g' $(STAGING)/metadata.yaml
sed -i 's/HELM_REPLACE_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)/
# Calculate checksum of all files in staging for the fluxcd app
cd $(STAGING) && find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
# Package fluxcd app
tar cfz $(APP_TARBALL) -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) $(APP_FOLDER)
override_dh_usrlocal: