Add Debian packaging for portieris app
Create Debian packages for portieris-helm, python-k8sapp-portieris and stx-portieris-helm packages. Story: 2009101 Task: 43845 Signed-off-by: Tracey Bogue <tracey.bogue@windriver.com> Change-Id: I7631737c9b8e5074db5b29c7b3e7f7b7d34e926e
This commit is contained in:
parent
2a190a253c
commit
903861605a
3
debian_pkg_dirs
Normal file
3
debian_pkg_dirs
Normal file
@ -0,0 +1,3 @@
|
||||
portieris-helm
|
||||
stx-portieris-helm
|
||||
python-k8sapp-portieris
|
5
portieris-helm/debian/deb_folder/changelog
Normal file
5
portieris-helm/debian/deb_folder/changelog
Normal file
@ -0,0 +1,5 @@
|
||||
portieris-helm (1.0-1) unstable; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- Tracey Bogue <tracey.bogue@windriver.com> Wed, 3 Nov 2021 13:02:42 +0000
|
17
portieris-helm/debian/deb_folder/control
Normal file
17
portieris-helm/debian/deb_folder/control
Normal file
@ -0,0 +1,17 @@
|
||||
Source: portieris-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: portieris-helm
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}
|
||||
Description: StarlingX Portieris Helm Charts
|
||||
This package contains helm charts for the portieris application.
|
41
portieris-helm/debian/deb_folder/copyright
Normal file
41
portieris-helm/debian/deb_folder/copyright
Normal file
@ -0,0 +1,41 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: portieris-helm
|
||||
Source: https://opendev.org/starlingx/portieris-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'.
|
1
portieris-helm/debian/deb_folder/portieris-helm.install
Normal file
1
portieris-helm/debian/deb_folder/portieris-helm.install
Normal file
@ -0,0 +1 @@
|
||||
usr/lib/helm/*
|
32
portieris-helm/debian/deb_folder/rules
Executable file
32
portieris-helm/debian/deb_folder/rules
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/make -f
|
||||
# export DH_VERBOSE = 1
|
||||
|
||||
export ROOT = debian/tmp
|
||||
export CHART_FOLDER = $(ROOT)/usr/lib/helm
|
||||
export PORTIERIS_VERSION = 0.7.0
|
||||
export PORTIERIS_TARBALL = portieris-$(PORTIERIS_VERSION).tgz
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_auto_build:
|
||||
# Apply patches.
|
||||
patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0001-Squash-required-portieris-fixes.patch
|
||||
patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0002-add-image-pull-secrets-to-images.patch
|
||||
patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0003-add-toggle-to-reinstall-the-admission-webhook.patch
|
||||
patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0004-run-admission-webhooks-as-non-root.patch
|
||||
patch -d portieris --no-backup-if-mismatch --fuzz=0 -p1 < 0005-add-toleration.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
|
||||
# Create the TGZ file.
|
||||
cd portieris && 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/$(PORTIERIS_TARBALL) $(CHART_FOLDER)
|
1
portieris-helm/debian/deb_folder/source/format
Normal file
1
portieris-helm/debian/deb_folder/source/format
Normal file
@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
25
portieris-helm/debian/dl_hook
Executable file
25
portieris-helm/debian/dl_hook
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
PKG_BUILD_NAME=$1
|
||||
PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME})
|
||||
PKG_DIR="portieris-helm"
|
||||
STX_BASE=$(realpath ${MY_REPO}/stx)
|
||||
SRC=$(realpath ${STX_BASE}/portieris-armada-app/${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 portieris source package.
|
||||
PORTIERIS_PKG="portieris-0.7.0.tgz"
|
||||
PORTIERIS_SRC_PATH=$(realpath ${STX_MIRROR}/downloads/${PORTIERIS_PKG})
|
||||
cp ${PORTIERIS_SRC_PATH} ${PKG_BUILD_ROOT}
|
||||
|
||||
# Extract the portieris tar file.
|
||||
tar xfz ${PORTIERIS_PKG}
|
||||
|
||||
# Copy source files to the build directory.
|
||||
cp -pr ${SRC}/files/* ${PKG_BUILD_ROOT}
|
7
portieris-helm/debian/meta_data.yaml
Normal file
7
portieris-helm/debian/meta_data.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
debname: portieris-helm
|
||||
debver: 1.0-1
|
||||
dl_hook: dl_hook
|
||||
revision:
|
||||
dist: $STX_DIST
|
||||
PKG_GITREVCOUNT: true
|
5
python-k8sapp-portieris/debian/deb_folder/changelog
Normal file
5
python-k8sapp-portieris/debian/deb_folder/changelog
Normal file
@ -0,0 +1,5 @@
|
||||
python3-k8sapp-portieris (1.0-1) unstable; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- Tracey Bogue <tracey.bogue@windriver.com> Wed, 3 Nov 2021 13:35:42 +0000
|
26
python-k8sapp-portieris/debian/deb_folder/control
Normal file
26
python-k8sapp-portieris/debian/deb_folder/control
Normal file
@ -0,0 +1,26 @@
|
||||
Source: python3-k8sapp-portieris
|
||||
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-portieris
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${python3:Depends}
|
||||
Description: StarlingX Sysinv Portieris Extensions
|
||||
This package contains sysinv plugins for the portieris K8S app.
|
||||
|
||||
Package: python3-k8sapp-portieris-wheels
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}, ${python3:Depends}, python3-wheel
|
||||
Description: StarlingX Sysinv Portieris Extension Wheels
|
||||
This package contains python wheels for the portieris K8S app plugins.
|
41
python-k8sapp-portieris/debian/deb_folder/copyright
Normal file
41
python-k8sapp-portieris/debian/deb_folder/copyright
Normal file
@ -0,0 +1,41 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: python3-k8sapp-portieris
|
||||
Source: https://opendev.org/starlingx/portieris-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'.
|
@ -0,0 +1 @@
|
||||
plugins/portieris/*.whl
|
@ -0,0 +1,2 @@
|
||||
usr/lib/python3/dist-packages/k8sapp_portieris-1.0.0.egg-info/*
|
||||
usr/lib/python3/dist-packages/k8sapp_portieris/*
|
26
python-k8sapp-portieris/debian/deb_folder/rules
Executable file
26
python-k8sapp-portieris/debian/deb_folder/rules
Executable file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/make -f
|
||||
# export DH_VERBOSE = 1
|
||||
|
||||
export APP_NAME=portieris
|
||||
export PBR_VERSION=1.0.0
|
||||
export PYBUILD_NAME=k8sapp-portieris
|
||||
export ROOT=$(CURDIR)/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 --install-layout=deb --skip-build --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
|
1
python-k8sapp-portieris/debian/deb_folder/source/format
Normal file
1
python-k8sapp-portieris/debian/deb_folder/source/format
Normal file
@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
7
python-k8sapp-portieris/debian/meta_data.yaml
Normal file
7
python-k8sapp-portieris/debian/meta_data.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
debname: python3-k8sapp-portieris
|
||||
debver: 1.0-1
|
||||
src_path: k8sapp_portieris
|
||||
revision:
|
||||
dist: $STX_DIST
|
||||
PKG_GITREVCOUNT: true
|
5
stx-portieris-helm/debian/deb_folder/changelog
Normal file
5
stx-portieris-helm/debian/deb_folder/changelog
Normal file
@ -0,0 +1,5 @@
|
||||
stx-portieris-helm (1.0-1) unstable; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- Tracey Bogue <tracey.bogue@windriver.com> Wed, 3 Nov 2021 13:48:42 +0000
|
21
stx-portieris-helm/debian/deb_folder/control
Normal file
21
stx-portieris-helm/debian/deb_folder/control
Normal file
@ -0,0 +1,21 @@
|
||||
Source: stx-portieris-helm
|
||||
Section: libs
|
||||
Priority: optional
|
||||
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
|
||||
Build-Depends: debhelper-compat (= 13),
|
||||
chartmuseum,
|
||||
helm,
|
||||
portieris-helm,
|
||||
procps,
|
||||
python3-k8sapp-portieris,
|
||||
python3-k8sapp-portieris-wheels
|
||||
Standards-Version: 4.5.1
|
||||
Homepage: https://www.starlingx.io
|
||||
|
||||
Package: stx-portieris-helm
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}
|
||||
Description: StarlingX Portieris Armada Helm Charts
|
||||
This package contains Armada helm charts for the portieris
|
||||
application.
|
41
stx-portieris-helm/debian/deb_folder/copyright
Normal file
41
stx-portieris-helm/debian/deb_folder/copyright
Normal file
@ -0,0 +1,41 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: stx-portieris-helm
|
||||
Source: https://opendev.org/starlingx/portieris-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'.
|
58
stx-portieris-helm/debian/deb_folder/rules
Executable file
58
stx-portieris-helm/debian/deb_folder/rules
Executable file
@ -0,0 +1,58 @@
|
||||
#!/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 = portieris
|
||||
export APP_VERSION = $(MAJOR).$(MINOR_PATCH)
|
||||
export APP_TARBALL = $(APP_NAME)-$(APP_VERSION).tgz
|
||||
export HELM_FOLDER = /usr/lib/helm
|
||||
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 && helm lint portieris-certs
|
||||
cd helm-charts && helm package portieris-certs
|
||||
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 $(HELM_FOLDER)/portieris*.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:
|
1
stx-portieris-helm/debian/deb_folder/source/format
Normal file
1
stx-portieris-helm/debian/deb_folder/source/format
Normal file
@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
@ -0,0 +1 @@
|
||||
usr/local/share/applications/helm/*
|
20
stx-portieris-helm/debian/dl_hook
Executable file
20
stx-portieris-helm/debian/dl_hook
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
PKG_BUILD_NAME=$1
|
||||
PKG_BUILD_ROOT=$(realpath `pwd`/${PKG_BUILD_NAME})
|
||||
PKG_DIR="stx-portieris-helm"
|
||||
|
||||
STX_BASE=$(realpath ${MY_REPO}/stx)
|
||||
SRC=$(realpath ${STX_BASE}/portieris-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 to the build directory.
|
||||
cp -pr ${SRC}/files ${PKG_BUILD_ROOT}
|
||||
cp -pr ${SRC}/helm-charts/* ${PKG_BUILD_ROOT}/helm-charts
|
||||
cp -pr ${SRC}/manifests ${PKG_BUILD_ROOT}
|
7
stx-portieris-helm/debian/meta_data.yaml
Normal file
7
stx-portieris-helm/debian/meta_data.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
debname: stx-portieris-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