Standardize app configs

Fixed versioning and adjusted some build files
to bring them as close to a standard as possible.

- Removed centos files
- Added version tracking via GITREVCOUNT
- Fixed mismatch in plugin name, set to python3-k8sapp-<app>
- Standardized plugin debian files (rules, *.install)
- Plugin wheels saved to /plugin instead of /plugin/<app>

Test Plan:
PASS - Build-pkgs -a
PASS - Build-image
PASS - Install, bootstrap, unlock
PASS - app tarball contains wheel file
PASS - wheel versioning updated properly

Story: 2010542
Task: 47181

Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: I4626798a5babba42696349b86219c30a9c702fd8
This commit is contained in:
Leonardo Fagundes Luz Serrano 2022-12-20 16:44:19 -03:00
parent c755f088ff
commit dbef3ff776
29 changed files with 52 additions and 40 deletions

View File

@ -17,7 +17,7 @@
Run py39 for KubeVirt app
nodeset: debian-bullseye
files:
- python-k8sapp-kubevirt/*
- python3-k8sapp-kubevirt/*
vars:
tox_envlist: py39
python_version: 3.9
@ -27,7 +27,7 @@
description: |
Run pylint test for k8sapp_kubevirt
files:
- python-k8sapp-kubevirt/*
- python3-k8sapp-kubevirt/*
vars:
tox_envlist: pylint

View File

@ -1,2 +1,2 @@
python3-k8sapp-kubevirt
stx-kubevirt-app-helm
python-k8sapp-kubevirt

View File

@ -1 +0,0 @@
plugins/kubevirt-app/*.whl

View File

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

View File

@ -1,20 +0,0 @@
#!/usr/bin/make -f
# export DH_VERBOSE = 1
export APP_NAME=kubevirt-app
export PBR_VERSION=1.0.0
export PYBUILD_NAME=k8sapp-kubevirt
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)

View File

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

View File

@ -3,4 +3,3 @@ python3-k8sapp-kubevirt (1.0-1) unstable; urgency=medium
* Initial Release
-- Gleb Aronsky <gleb.aronsky@windriver.com> Mon, 1 Aug 2022 08:00:00 +0000

View File

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

View File

@ -0,0 +1 @@
usr/lib/python3/dist-packages/k8sapp_*

View File

@ -0,0 +1,33 @@
#!/usr/bin/make -f
# export DH_VERBOSE = 1
export APP_NAME = kubevirt-app
export PYBUILD_NAME = k8sapp-kubevirt
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 4 -d '.')
export PBR_VERSION = $(MAJOR).$(MINOR_PATCH)
export ROOT = $(CURDIR)/debian/tmp
export SKIP_PIP_INSTALL = 1
%:
dh $@ --with=python3 --buildsystem=pybuild
override_dh_auto_install:
env | sort
python3 setup.py install \
--install-layout=deb \
--root $(ROOT)
python3 setup.py bdist_wheel \
--universal \
-d $(ROOT)/plugins
override_dh_python3:
dh_python3 --shebang=/usr/bin/python3
override_dh_auto_test:
PYTHONDIR=$(CURDIR) stestr run

View File

@ -0,0 +1,9 @@
---
debname: python3-k8sapp-kubevirt
debver: 1.0-1
src_path: k8sapp_kubevirt
revision:
dist: $STX_DIST
GITREVCOUNT:
SRC_DIR: ${MY_REPO}/stx/app-kubevirt
BASE_SRCREV: af643044e26ead2d5ac2c502015bcb73ee892bfa

View File

@ -31,5 +31,5 @@ systemconfig.app_lifecycle =
systemconfig.helm_plugins.kubevirt =
001_kubevirt-app = k8sapp_kubevirt.helm.kubevirt:KubeVirtHelm
[wheel]
[bdist_wheel]
universal = 1

View File

@ -31,7 +31,7 @@ override_dh_auto_build:
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
cp /plugins/*.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)/ .

View File

@ -8,7 +8,6 @@ debver: 1.0-1
src_path: stx-kubevirt-app-helm
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true
behavior:
platform_managed_app: yes
desired_state: uploaded
GITREVCOUNT:
SRC_DIR: ${MY_REPO}/stx/app-kubevirt
BASE_SRCREV: af643044e26ead2d5ac2c502015bcb73ee892bfa