Add Debian packaging for metrics-server-armada-app
Create Debian packages for stx-metrics-server-helm packages. Story: 2009101 Task: 43854 Signed-off-by: Bernardo Decco de Siqueira <bernardo.deccodesiqueira@windriver.com> Change-Id: I6734f8cfd1f2e195723e0dc88c034380cae8e4f1
This commit is contained in:
parent
981e975787
commit
204c71c7e1
1
debian_pkg_dirs
Normal file
1
debian_pkg_dirs
Normal file
@ -0,0 +1 @@
|
||||
stx-metrics-server-helm
|
5
stx-metrics-server-helm/debian/deb_folder/changelog
Normal file
5
stx-metrics-server-helm/debian/deb_folder/changelog
Normal file
@ -0,0 +1,5 @@
|
||||
stx-metrics-server-helm (1.0-1) unstable; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- Bernardo Decco de Siqueira <bernardo.deccodesiqueira@windriver.com> Wed, 05 Nov 2021 16:00:42 +0000
|
18
stx-metrics-server-helm/debian/deb_folder/control
Normal file
18
stx-metrics-server-helm/debian/deb_folder/control
Normal file
@ -0,0 +1,18 @@
|
||||
Source: stx-metrics-server-helm
|
||||
Section: libs
|
||||
Priority: optional
|
||||
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
|
||||
Build-Depends: debhelper-compat (= 13),
|
||||
chartmuseum,
|
||||
helm,
|
||||
procps
|
||||
Standards-Version: 4.5.1
|
||||
Homepage: https://www.starlingx.io
|
||||
|
||||
Package: stx-metrics-server-helm
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}
|
||||
Description: StarlingX Metrics Server Armada Helm Charts
|
||||
This package contains Armada helm charts for the metrics server
|
||||
application.
|
26
stx-metrics-server-helm/debian/deb_folder/copyright
Normal file
26
stx-metrics-server-helm/debian/deb_folder/copyright
Normal file
@ -0,0 +1,26 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: stx-metrics-server-helm
|
||||
Upstream-Contact: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
|
||||
Source: https://opendev.org/starlingx/metrics-server-armada-app/
|
||||
|
||||
Files: *
|
||||
Copyright: (c) 2017-2021 Wind River Systems, Inc
|
||||
License: Apache-2
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2021 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'.
|
52
stx-metrics-server-helm/debian/deb_folder/rules
Normal file
52
stx-metrics-server-helm/debian/deb_folder/rules
Normal file
@ -0,0 +1,52 @@
|
||||
#!/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 MAJOR = $(shell echo $(DEB_VERSION) | cut -f 1 -d '.')
|
||||
export MINOR_PATCH = $(shell echo $(DEB_VERSION) | cut -f 2 -d '.')
|
||||
|
||||
export APP_NAME = metrics-server
|
||||
export APP_VERSION = $(MAJOR).$(MINOR_PATCH)
|
||||
export APP_TARBALL = $(APP_NAME)-$(APP_VERSION).tgz
|
||||
export HELM_REPO = stx-platform
|
||||
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 && make
|
||||
# Terminate the helm chart server.
|
||||
pkill chartmuseum
|
||||
# Setup the staging directory.
|
||||
mkdir -p $(STAGING)
|
||||
cp files/metadata.yaml $(STAGING)
|
||||
cp manifests/*.yaml $(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
|
||||
# Create the app package.
|
||||
cd $(STAGING) && find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
|
||||
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_auto_test:
|
||||
|
||||
override_dh_usrlocal:
|
1
stx-metrics-server-helm/debian/deb_folder/source/format
Normal file
1
stx-metrics-server-helm/debian/deb_folder/source/format
Normal file
@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
@ -0,0 +1 @@
|
||||
usr/local/share/applications/helm/*
|
18
stx-metrics-server-helm/debian/dl_hook
Executable file
18
stx-metrics-server-helm/debian/dl_hook
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
PKG_BUILD_NAME=$1
|
||||
PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME})
|
||||
PKG_DIR="stx-metrics-server-helm"
|
||||
|
||||
STX_BASE=$(realpath ${MY_REPO}/stx)
|
||||
SRC=$(realpath ${STX_BASE}/metrics-server-armada-app/${PKG_DIR}/${PKG_DIR})
|
||||
PSP_HELM_CHARTS=$(realpath ${STX_BASE}/helm-charts/psp-rolebinding/psp-rolebinding/helm-charts)
|
||||
|
||||
mkdir -p ${PKG_BUILD_ROOT}
|
||||
|
||||
# Copy PSP rolebinding helm charts to the build directory.
|
||||
cp -pr ${PSP_HELM_CHARTS} ${PKG_BUILD_ROOT}
|
||||
cp -pr ${SRC}/files ${PKG_BUILD_ROOT}
|
||||
cp -pr ${SRC}/helm-charts/ ${PKG_BUILD_ROOT}
|
||||
cp -pr ${SRC}/manifests ${PKG_BUILD_ROOT}
|
7
stx-metrics-server-helm/debian/meta_data.yaml
Normal file
7
stx-metrics-server-helm/debian/meta_data.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
debname: stx-metrics-server-helm
|
||||
debver: 1.0-1
|
||||
dl_hook: dl_hook
|
||||
revision:
|
||||
dist: $STX_DIST
|
||||
PKG_GITREVCOUNT: true
|
Loading…
x
Reference in New Issue
Block a user