diff --git a/debian_pkg_dirs b/debian_pkg_dirs index d7b2b1b..d06aae6 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -1,3 +1,4 @@ -portieris-helm +helm-charts/upstream/portieris-helm +helm-charts/custom/portieris-certs-helm python3-k8sapp-portieris stx-portieris-helm diff --git a/helm-charts/custom/portieris-certs-helm/debian/deb_folder/changelog b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/changelog new file mode 100644 index 0000000..2f239eb --- /dev/null +++ b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/changelog @@ -0,0 +1,5 @@ +portieris-certs-helm (0.1-0) unstable; urgency=medium + + * Initial release. + + -- Tae Park Thu, 30 May 2024 13:02:42 +0000 diff --git a/helm-charts/custom/portieris-certs-helm/debian/deb_folder/control b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/control new file mode 100644 index 0000000..a570457 --- /dev/null +++ b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/control @@ -0,0 +1,15 @@ +Source: portieris-certs-helm +Section: libs +Priority: optional +Maintainer: StarlingX Developers +Build-Depends: debhelper-compat (= 13), + helm +Standards-Version: 4.5.1 +Homepage: https://www.starlingx.io + +Package: portieris-certs-helm +Section: libs +Architecture: any +Depends: ${misc:Depends} +Description: StarlingX Portieris Certs Helm Charts + This package contains helm chart Portieris Certs for the portieris application. diff --git a/helm-charts/custom/portieris-certs-helm/debian/deb_folder/copyright b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/copyright new file mode 100644 index 0000000..20c0ad4 --- /dev/null +++ b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/copyright @@ -0,0 +1,21 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: portieris-certs-helm +Source: https://opendev.org/starlingx/portieris-armada-app/ + +Files: * +Copyright: (c) 2020-2024 Wind River Systems, Inc +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + https://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/portieris-helm/debian/deb_folder/portieris-helm.install b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/portieris-certs-helm.install similarity index 100% rename from portieris-helm/debian/deb_folder/portieris-helm.install rename to helm-charts/custom/portieris-certs-helm/debian/deb_folder/portieris-certs-helm.install diff --git a/helm-charts/custom/portieris-certs-helm/debian/deb_folder/rules b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/rules new file mode 100755 index 0000000..e985253 --- /dev/null +++ b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/rules @@ -0,0 +1,22 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') +export PATCH_VERSION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.') +export PORTIERIS_BASE_VERSION = $(shell echo $(DEB_VERSION) | cut -f 1 -d '-') +export PORTIERIS_VERSION = $(PORTIERIS_BASE_VERSION).$(PATCH_VERSION) + +export ROOT = debian/tmp +export CHART_FOLDER = $(ROOT)/usr/lib/helm + +%: + dh $@ + +override_dh_auto_build: + + make CHART_VERSION=$(PORTIERIS_VERSION) portieris-certs + +override_dh_auto_install: + # Install the app tar file. + install -d -m 755 $(CHART_FOLDER) + install -p -D -m 755 portieris-certs*.tgz $(CHART_FOLDER) diff --git a/portieris-helm/debian/deb_folder/source/format b/helm-charts/custom/portieris-certs-helm/debian/deb_folder/source/format similarity index 100% rename from portieris-helm/debian/deb_folder/source/format rename to helm-charts/custom/portieris-certs-helm/debian/deb_folder/source/format diff --git a/helm-charts/custom/portieris-certs-helm/debian/meta_data.yaml b/helm-charts/custom/portieris-certs-helm/debian/meta_data.yaml new file mode 100644 index 0000000..4f6bf0f --- /dev/null +++ b/helm-charts/custom/portieris-certs-helm/debian/meta_data.yaml @@ -0,0 +1,10 @@ +--- +debname: portieris-certs-helm +debver: 0.1-0 +src_path: portieris-certs-helm +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true + GITREVCOUNT: + SRC_DIR: ${MY_REPO}/stx/portieris-armada-app/helm-charts/custom/portieris-certs-helm + BASE_SRCREV: 419816d74a38e978a2743365052073719dc0cc8b diff --git a/stx-portieris-helm/stx-portieris-helm/helm-charts/Makefile b/helm-charts/custom/portieris-certs-helm/portieris-certs-helm/Makefile similarity index 86% rename from stx-portieris-helm/stx-portieris-helm/helm-charts/Makefile rename to helm-charts/custom/portieris-certs-helm/portieris-certs-helm/Makefile index 5cf4447..277005b 100644 --- a/stx-portieris-helm/stx-portieris-helm/helm-charts/Makefile +++ b/helm-charts/custom/portieris-certs-helm/portieris-certs-helm/Makefile @@ -1,7 +1,7 @@ # # Copyright 2017 The Openstack-Helm Authors. # -# Copyright (c) 2018 Wind River Systems, Inc. +# Copyright (c) 2024 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # @@ -31,12 +31,11 @@ lint-%: init-% if [ -d $* ]; then helm lint $*; fi build-%: lint-% - if [ -d $* ]; then helm package $*; fi + if [ -d $* ]; then helm package --version $(CHART_VERSION) $*; fi clean: @echo "Clean all build artifacts" rm -f */templates/_partials.tpl */templates/_globals.tpl - rm -f *tgz */charts/*tgz */requirements.lock rm -rf */charts */tmpcharts %: diff --git a/stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/Chart.yaml b/helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/Chart.yaml similarity index 100% rename from stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/Chart.yaml rename to helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/Chart.yaml diff --git a/stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/templates/certificate.yaml b/helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/templates/certificate.yaml similarity index 100% rename from stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/templates/certificate.yaml rename to helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/templates/certificate.yaml diff --git a/stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/templates/issuer.yaml b/helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/templates/issuer.yaml similarity index 100% rename from stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/templates/issuer.yaml rename to helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/templates/issuer.yaml diff --git a/stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/templates/secret.yaml b/helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/templates/secret.yaml similarity index 100% rename from stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/templates/secret.yaml rename to helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/templates/secret.yaml diff --git a/stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/values.yaml b/helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/values.yaml similarity index 100% rename from stx-portieris-helm/stx-portieris-helm/helm-charts/portieris-certs/values.yaml rename to helm-charts/custom/portieris-certs-helm/portieris-certs-helm/portieris-certs/values.yaml diff --git a/portieris-helm/debian/deb_folder/changelog b/helm-charts/upstream/portieris-helm/debian/deb_folder/changelog similarity index 67% rename from portieris-helm/debian/deb_folder/changelog rename to helm-charts/upstream/portieris-helm/debian/deb_folder/changelog index 7c5f142..e4bf147 100644 --- a/portieris-helm/debian/deb_folder/changelog +++ b/helm-charts/upstream/portieris-helm/debian/deb_folder/changelog @@ -1,4 +1,4 @@ -portieris-helm (1.0-1) unstable; urgency=medium +portieris-helm (0.13-10) unstable; urgency=medium * Initial release. diff --git a/portieris-helm/debian/deb_folder/control b/helm-charts/upstream/portieris-helm/debian/deb_folder/control similarity index 95% rename from portieris-helm/debian/deb_folder/control rename to helm-charts/upstream/portieris-helm/debian/deb_folder/control index a4a396f..020ead7 100644 --- a/portieris-helm/debian/deb_folder/control +++ b/helm-charts/upstream/portieris-helm/debian/deb_folder/control @@ -3,9 +3,8 @@ Section: libs Priority: optional Maintainer: StarlingX Developers Build-Depends: debhelper-compat (= 13), - chartmuseum, helm, - procps + build-info Standards-Version: 4.5.1 Homepage: https://www.starlingx.io diff --git a/portieris-helm/debian/deb_folder/copyright b/helm-charts/upstream/portieris-helm/debian/deb_folder/copyright similarity index 100% rename from portieris-helm/debian/deb_folder/copyright rename to helm-charts/upstream/portieris-helm/debian/deb_folder/copyright diff --git a/portieris-helm/debian/deb_folder/patches/0001-Add-permissive-cluster-policy-by-default.patch b/helm-charts/upstream/portieris-helm/debian/deb_folder/patches/0001-Add-permissive-cluster-policy-by-default.patch similarity index 100% rename from portieris-helm/debian/deb_folder/patches/0001-Add-permissive-cluster-policy-by-default.patch rename to helm-charts/upstream/portieris-helm/debian/deb_folder/patches/0001-Add-permissive-cluster-policy-by-default.patch diff --git a/portieris-helm/debian/deb_folder/patches/series b/helm-charts/upstream/portieris-helm/debian/deb_folder/patches/series similarity index 100% rename from portieris-helm/debian/deb_folder/patches/series rename to helm-charts/upstream/portieris-helm/debian/deb_folder/patches/series diff --git a/helm-charts/upstream/portieris-helm/debian/deb_folder/portieris-helm.install b/helm-charts/upstream/portieris-helm/debian/deb_folder/portieris-helm.install new file mode 100644 index 0000000..8a0c6de --- /dev/null +++ b/helm-charts/upstream/portieris-helm/debian/deb_folder/portieris-helm.install @@ -0,0 +1 @@ +usr/lib/helm/* diff --git a/helm-charts/upstream/portieris-helm/debian/deb_folder/rules b/helm-charts/upstream/portieris-helm/debian/deb_folder/rules new file mode 100755 index 0000000..fc13fec --- /dev/null +++ b/helm-charts/upstream/portieris-helm/debian/deb_folder/rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export DEB_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') +export PATCH_VERSION = $(shell echo $(DEB_VERSION) | cut -f 4 -d '.') +export PORTIERIS_BASE_VERSION = $(shell echo $(DEB_VERSION) | sed 's/-/./' | cut -d '.' -f 1-3) +export PORTIERIS_VERSION = $(PORTIERIS_BASE_VERSION)+STX.$(PATCH_VERSION) +export PORTIERIS_TARBALL = portieris-$(PORTIERIS_VERSION).tgz + +export ROOT = debian/tmp +export CHART_FOLDER = $(ROOT)/usr/lib/helm + +%: + dh $@ + +override_dh_auto_build: + + cp Makefile helm + cd helm && make CHART_VERSION=$(PORTIERIS_VERSION) portieris + +override_dh_auto_install: + # Install the app tar file. + install -d -m 755 $(CHART_FOLDER) + install -p -D -m 755 helm/$(PORTIERIS_TARBALL) $(CHART_FOLDER) diff --git a/helm-charts/upstream/portieris-helm/debian/deb_folder/source/format b/helm-charts/upstream/portieris-helm/debian/deb_folder/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/helm-charts/upstream/portieris-helm/debian/deb_folder/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/portieris-helm/debian/meta_data.yaml b/helm-charts/upstream/portieris-helm/debian/meta_data.yaml similarity index 74% rename from portieris-helm/debian/meta_data.yaml rename to helm-charts/upstream/portieris-helm/debian/meta_data.yaml index e6a7f27..801236b 100644 --- a/portieris-helm/debian/meta_data.yaml +++ b/helm-charts/upstream/portieris-helm/debian/meta_data.yaml @@ -1,16 +1,18 @@ --- debname: portieris-helm -debver: 1.0-1 +debver: 0.13-10 dl_path: name: portieris-0.13.10.tgz url: https://github.com/IBM/portieris/archive/refs/tags/v0.13.10.tar.gz sha256sum: 8377029dc885bd50ff459ddc0d01aa274921b0024cc63bf969f2e72bf4b56f11 src_files: + - files/Makefile - files/index.yaml - files/repositories.yaml revision: dist: $STX_DIST + stx_patch: 1 PKG_GITREVCOUNT: true GITREVCOUNT: - SRC_DIR: ${MY_REPO}/stx/portieris-armada-app/portieris-helm/files + SRC_DIR: ${MY_REPO}/stx/portieris-armada-app/helm-charts/upstream/portieris-helm/files BASE_SRCREV: b2f895c371539899f7c9543c9c5dba8a897a1be3 diff --git a/portieris-helm/files/0001-Add-permissive-cluster-policy-by-default.patch b/helm-charts/upstream/portieris-helm/files/0001-Add-permissive-cluster-policy-by-default.patch similarity index 100% rename from portieris-helm/files/0001-Add-permissive-cluster-policy-by-default.patch rename to helm-charts/upstream/portieris-helm/files/0001-Add-permissive-cluster-policy-by-default.patch diff --git a/helm-charts/upstream/portieris-helm/files/Makefile b/helm-charts/upstream/portieris-helm/files/Makefile new file mode 100644 index 0000000..5457cb2 --- /dev/null +++ b/helm-charts/upstream/portieris-helm/files/Makefile @@ -0,0 +1,41 @@ +# +# Copyright 2017 The Openstack-Helm Authors. +# +# Copyright (c) 2019, 2024 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# +# It's necessary to set this because some environments don't link sh -> bash. +SHELL := /bin/bash +TASK := build + +EXCLUDES := doc tests tools logs tmp +CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) + +.PHONY: $(EXCLUDES) $(CHARTS) + +all: $(CHARTS) + +$(CHARTS): + @if [ -d $@ ]; then \ + echo; \ + echo "===== Processing [$@] chart ====="; \ + make $(TASK)-$@; \ + fi + +init-%: + if [ -f $*/Makefile ]; then make -C $*; fi + +lint-%: init-% + if [ -d $* ]; then helm lint $*; fi + +build-%: + if [ -d $* ]; then helm package --version $(CHART_VERSION) $*; fi + +clean: + @echo "Clean all build artifacts" + rm -f */templates/_partials.tpl */templates/_globals.tpl + rm -rf */charts */tmpcharts + +%: + @: diff --git a/portieris-helm/files/index.yaml b/helm-charts/upstream/portieris-helm/files/index.yaml similarity index 100% rename from portieris-helm/files/index.yaml rename to helm-charts/upstream/portieris-helm/files/index.yaml diff --git a/portieris-helm/files/repositories.yaml b/helm-charts/upstream/portieris-helm/files/repositories.yaml similarity index 100% rename from portieris-helm/files/repositories.yaml rename to helm-charts/upstream/portieris-helm/files/repositories.yaml diff --git a/portieris-helm/portieris/README b/helm-charts/upstream/portieris-helm/portieris/README similarity index 100% rename from portieris-helm/portieris/README rename to helm-charts/upstream/portieris-helm/portieris/README diff --git a/portieris-helm/debian/deb_folder/rules b/portieris-helm/debian/deb_folder/rules deleted file mode 100755 index bfbf7f4..0000000 --- a/portieris-helm/debian/deb_folder/rules +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/make -f -# export DH_VERBOSE = 1 - -export ROOT = debian/tmp -export CHART_FOLDER = $(ROOT)/usr/lib/helm -export PORTIERIS_VERSION = v0.13.10 -export PORTIERIS_TARBALL = portieris-$(PORTIERIS_VERSION).tgz - -%: - dh $@ - -override_dh_auto_build: - # Host a server for the helm charts. - chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" \ - --storage-local-rootdir="." & - sleep 2 - helm repo add local http://localhost:8879/charts - # Create the TGZ file. - make helm.package - # Terminate the helm chart server. - pkill chartmuseum - -override_dh_auto_install: - # Install the app tar file. - install -d -m 755 $(CHART_FOLDER) - install -p -D -m 755 $(PORTIERIS_TARBALL) $(CHART_FOLDER) diff --git a/stx-portieris-helm/debian/deb_folder/control b/stx-portieris-helm/debian/deb_folder/control index 8d2e6bd..38c7bd8 100644 --- a/stx-portieris-helm/debian/deb_folder/control +++ b/stx-portieris-helm/debian/deb_folder/control @@ -3,11 +3,9 @@ Section: libs Priority: optional Maintainer: StarlingX Developers Build-Depends: debhelper-compat (= 13), - chartmuseum, helm, portieris-helm, - procps, - python3-k8sapp-portieris, + portieris-certs-helm, python3-k8sapp-portieris-wheels, build-info Standards-Version: 4.5.1 @@ -17,6 +15,6 @@ Package: stx-portieris-helm Section: libs Architecture: any Depends: ${misc:Depends} -Description: StarlingX Portieris FluxCD Helm Charts - This package contains FluxCD helm charts for the portieris +Description: StarlingX Portieris FluxCD application. + This package contains FluxCD manifests for the portieris application. diff --git a/stx-portieris-helm/debian/deb_folder/rules b/stx-portieris-helm/debian/deb_folder/rules index f90d9e9..19a7108 100755 --- a/stx-portieris-helm/debian/deb_folder/rules +++ b/stx-portieris-helm/debian/deb_folder/rules @@ -19,26 +19,28 @@ export STAGING = staging dh $@ override_dh_auto_build: - # Host a server for the helm charts. - chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" \ - --storage-local-rootdir="." & - sleep 2 - helm repo add local http://localhost:8879/charts - - # Create the TGZ file. - cd helm-charts && helm lint portieris-certs - cd helm-charts && helm package portieris-certs - - # Terminate the helm chart server. - pkill chartmuseum # Setup the staging directory. mkdir -p $(STAGING) cp files/metadata.yaml $(STAGING) mkdir -p $(STAGING)/charts - cp helm-charts/portieris*.tgz $(STAGING)/charts cp $(HELM_FOLDER)/portieris*.tgz $(STAGING)/charts + # Prepare staging for fluxcd package + cp -R fluxcd-manifests $(STAGING)/ + + # Adjust the helmrelease yamls based on the chart versions + for c in $(STAGING)/charts/*; do \ + chart=$$(basename $$c .tgz); \ + chart_name=$${chart%-*}; \ + chart_version=$${chart##*-}; \ + echo "Found $$chart; name: $$chart_name, version: $$chart_version"; \ + chart_manifest=$$(find $(STAGING)/fluxcd-manifests/$$chart_name -name helmrelease.yaml -exec grep -q $$chart_name {} \; -print); \ + echo "Updating manifest: $$chart_manifest"; \ + sed -i "s/REPLACE_HELM_CHART_VERSION/$$chart_version/g" $$chart_manifest; \ + grep version $$chart_manifest; \ + done + # 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 @@ -48,9 +50,6 @@ override_dh_auto_build: 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 diff --git a/stx-portieris-helm/stx-portieris-helm/fluxcd-manifests/portieris-certs/helmrelease.yaml b/stx-portieris-helm/stx-portieris-helm/fluxcd-manifests/portieris-certs/helmrelease.yaml index 0f46567..3be15ba 100644 --- a/stx-portieris-helm/stx-portieris-helm/fluxcd-manifests/portieris-certs/helmrelease.yaml +++ b/stx-portieris-helm/stx-portieris-helm/fluxcd-manifests/portieris-certs/helmrelease.yaml @@ -15,7 +15,7 @@ spec: chart: spec: chart: portieris-certs - version: 0.1.0 + version: REPLACE_HELM_CHART_VERSION sourceRef: kind: HelmRepository name: stx-platform diff --git a/stx-portieris-helm/stx-portieris-helm/fluxcd-manifests/portieris/helmrelease.yaml b/stx-portieris-helm/stx-portieris-helm/fluxcd-manifests/portieris/helmrelease.yaml index 9902a82..7261166 100644 --- a/stx-portieris-helm/stx-portieris-helm/fluxcd-manifests/portieris/helmrelease.yaml +++ b/stx-portieris-helm/stx-portieris-helm/fluxcd-manifests/portieris/helmrelease.yaml @@ -15,7 +15,7 @@ spec: chart: spec: chart: portieris - version: 0.13.10 + version: REPLACE_HELM_CHART_VERSION sourceRef: kind: HelmRepository name: stx-platform