Add Debian packaging for vault app

Create Debian packages for vault-helm, python-k8sapp-vault
and stx-vault-helm.

Signed-off-by: Tracey Bogue <tracey.bogue@windriver.com>
Change-Id: Ifb0c1de001e75e01e501c0078d85e562dc802d84
This commit is contained in:
Tracey Bogue 2021-11-04 14:18:46 -05:00
parent dda6626bed
commit ccdb17d296
25 changed files with 398 additions and 0 deletions

3
debian_pkg_dirs Normal file
View File

@ -0,0 +1,3 @@
python-k8sapp-vault
stx-vault-helm
vault-helm

View File

@ -0,0 +1,5 @@
python3-k8sapp-vault (1.0-1) unstable; urgency=medium
* Initial release.
-- Tracey Bogue <tracey.bogue@windriver.com> Thu, 4 Nov 2021 13:55:42 +0000

View File

@ -0,0 +1,26 @@
Source: python3-k8sapp-vault
Section: libs
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13),
dh-python,
python3-all,
python3-pbr,
python3-setuptools,
python3-wheel
Standards-Version: 4.5.1
Homepage: https://www.starlingx.io
Package: python3-k8sapp-vault
Section: libs
Architecture: any
Depends: ${misc:Depends}, ${python3:Depends}
Description: StarlingX Sysinv Vault Extensions
This package contains sysinv plugins for the vault K8S app.
Package: python3-k8sapp-vault-wheels
Section: libs
Architecture: any
Depends: ${misc:Depends}, ${python3:Depends}, python3-wheel
Description: StarlingX Sysinv Vault Extension Wheels
This package contains python wheels for the vault K8S app plugins.

View File

@ -0,0 +1,41 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: python3-k8sapp-vault
Source: https://opendev.org/starlingx/vault-armada-app/
Files: *
Copyright: (c) 2013-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'.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
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'.

View File

@ -0,0 +1 @@
plugins/vault/*.whl

View File

@ -0,0 +1,2 @@
usr/lib/python3/dist-packages/k8sapp_vault-1.0.0.egg-info/*
usr/lib/python3/dist-packages/k8sapp_vault/*

View File

@ -0,0 +1,26 @@
#!/usr/bin/make -f
# export DH_VERBOSE = 1
export APP_NAME=vault
export PBR_VERSION=1.0.0
export PYBUILD_NAME=k8sapp-vault
export ROOT=debian/tmp
export SKIP_PIP_INSTALL=1
%:
dh $@ --with=python3 --buildsystem=pybuild
override_dh_auto_build:
python3 setup.py build
override_dh_auto_install:
python3 setup.py install --skip-build --install-layout=deb --root $(ROOT)
python3 setup.py bdist_wheel \
--universal \
-d $(ROOT)/plugins/$(APP_NAME)
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
# (tbogue) FIXME
PYTHONDIR=$(CURDIR) stestr run || true
endif

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,7 @@
---
debname: python3-k8sapp-vault
debver: 1.0-1
src_path: k8sapp_vault
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true

View File

@ -0,0 +1,5 @@
stx-vault-helm (1.0-1) unstable; urgency=medium
* Initial release.
-- Tracey Bogue <tracey.bogue@windriver.com> Thu, 4 Nov 2021 14:10:42 +0000

View File

@ -0,0 +1,20 @@
Source: stx-vault-helm
Section: libs
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13),
vault-helm,
chartmuseum,
helm,
procps,
python3-k8sapp-vault,
python3-k8sapp-vault-wheels
Standards-Version: 4.5.1
Homepage: https://www.starlingx.io
Package: stx-vault-helm
Section: libs
Architecture: any
Depends: ${misc:Depends}
Description: StarlingX Vault Armada Helm Charts
This package contains Armada helm charts for the vault application.

View File

@ -0,0 +1,41 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: stx-vault-helm
Source: https://opendev.org/starlingx/vault-armada-app/
Files: *
Copyright: (c) 2013-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'.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
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'.

View File

@ -0,0 +1,55 @@
#!/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 = vault
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 psp-rolebinding
# 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
cp /usr/lib/helm/vault*.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/$(APP_NAME)/*.whl $(STAGING)/plugins
# 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_usrlocal:

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1 @@
usr/local/share/applications/helm/*

20
stx-vault-helm/debian/dl_hook Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
set -x
PKG_BUILD_NAME=$1
PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME})
PKG_DIR="stx-vault-helm"
STX_BASE=$(realpath ${MY_REPO}/stx)
SRC=$(realpath ${STX_BASE}/vault-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}
# Copy source files.
cp -pr ${SRC}/files ${PKG_BUILD_ROOT}
cp -pr ${SRC}/helm-charts/Makefile ${PKG_BUILD_ROOT}/helm-charts
cp -pr ${SRC}/manifests ${PKG_BUILD_ROOT}

View File

@ -0,0 +1,7 @@
---
debname: stx-vault-helm
debver: 1.0-1
dl_hook: dl_hook
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true

View File

@ -0,0 +1,5 @@
vault-helm (1.0-1) unstable; urgency=medium
* Initial release.
-- Tracey Bogue <tracey.bogue@windriver.com> Thu, 4 Nov 2021 13:08:42 +0000

View File

@ -0,0 +1,17 @@
Source: vault-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: vault-helm
Section: libs
Architecture: any
Depends: ${misc:Depends}
Description: StarlingX Vault Helm Charts
This package contains helm charts for the vault application.

View File

@ -0,0 +1,41 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: vault-helm
Source: https://opendev.org/starlingx/vault-armada-app/
Files: *
Copyright: (c) 2013-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'.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
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'.

View File

@ -0,0 +1,39 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1
export ROOT = debian/tmp
export APP_FOLDER = $(ROOT)/usr/lib/helm
export APP_TARBALL = vault-0.6.0.tgz
export STAGING = staging
export VAULT_CHART_DIR = helm-charts-vault
%:
dh $@
override_dh_auto_build:
# Apply patches.
patch -d $(VAULT_CHART_DIR) -p1 < 0001-Add-vault-manager-repository-to-values.yaml.patch
# 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
# Set up chart build files.
cp Makefile $(VAULT_CHART_DIR)
mkdir $(VAULT_CHART_DIR)/vault
cd $(VAULT_CHART_DIR) && cp Chart.yaml values.yaml vault
cp vault-init.yaml vault-certificates.yaml $(VAULT_CHART_DIR)/templates
cat _helpers-CA.tpl >> $(VAULT_CHART_DIR)/templates/_helpers.tpl
cd $(VAULT_CHART_DIR) && mv templates vault/templates
# Create the TGZ file.
cd $(VAULT_CHART_DIR) && make vault
# Terminate the helm chart server.
pkill chartmuseum
override_dh_auto_install:
# Install the app tar file.
install -d -m 755 $(APP_FOLDER)
install -p -D -m 755 $(VAULT_CHART_DIR)/$(APP_TARBALL) $(APP_FOLDER)
override_dh_auto_test:

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1 @@
usr/lib/helm/*

25
vault-helm/debian/dl_hook Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
set -x
PKG_BUILD_NAME=$1
PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME})
PKG_DIR="vault-helm"
STX_BASE=$(realpath ${MY_REPO}/stx)
SRC=$(realpath ${STX_BASE}/vault-armada-app/${PKG_DIR}/${PKG_DIR})
mkdir -p ${PKG_BUILD_ROOT}
pushd ${PKG_BUILD_ROOT}
# Local mirror workaround until CGCS_BASE mirror is supported.
STX_MIRROR=$(realpath "/import/mirrors/starlingx")
# Download vault helm chart source package.
VAULT_PKG="helm-charts-vault-0-6-0.tar.gz"
VAULT_SRC_PATH=$(realpath ${STX_MIRROR}/downloads/${VAULT_PKG})
cp ${VAULT_SRC_PATH} ${PKG_BUILD_ROOT}
# Extract the vault helm chart tar file.
tar xfzvv ${VAULT_PKG}
# Copy source files to the build directory.
cp -pr ${SRC}/files/* ${SRC}/helm-charts/* ${PKG_BUILD_ROOT}

View File

@ -0,0 +1,7 @@
---
debname: vault-helm
debver: 1.0-1
dl_hook: dl_hook
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true