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 PKG_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
PASS - app applied (SX vm)

Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
Change-Id: I9f5e8b1afc65de3b7d7ee05744ad39f5acc834de
This commit is contained in:
Leonardo Fagundes Luz Serrano 2022-12-21 06:47:46 -03:00
parent 07a1f13b5e
commit 809cdf6206
36 changed files with 42 additions and 36 deletions

View File

@ -26,11 +26,11 @@
- starlingx/update
- starlingx/utilities
files:
- python-k8sapp-vault/*
- python3-k8sapp-vault/*
vars:
tox_envlist: py39
python_version: 3.9
tox_extra_args: -c python-k8sapp-vault/k8sapp_vault/tox.ini
tox_extra_args: -c python3-k8sapp-vault/k8sapp_vault/tox.ini
- job:
name: stx-vault-armada-app-upload-git-mirror
parent: upload-git-mirror
@ -56,10 +56,10 @@
- starlingx/update
- starlingx/utilities
files:
- python-k8sapp-vault/*
- python3-k8sapp-vault/*
vars:
tox_envlist: pylint
tox_extra_args: -c python-k8sapp-vault/k8sapp_vault/tox.ini
tox_extra_args: -c python3-k8sapp-vault/k8sapp_vault/tox.ini
- secret:
name: stx-vault-armada-app-github-secret

View File

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

View File

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

View File

@ -1,26 +0,0 @@
#!/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 @@
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 = vault
export PYBUILD_NAME = k8sapp-vault
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

@ -35,5 +35,5 @@ systemconfig.helm_applications =
systemconfig.helm_plugins.vault =
001_vault = k8sapp_vault.helm.vault:VaultHelm
002_vault-psp-rolebinding = k8sapp_vault.helm.psp_rolebinding:PSPRolebindingHelm
[wheel]
[bdist_wheel]
universal = 1

View File

@ -44,7 +44,7 @@ override_dh_auto_build:
# Copy the plugins: installed in the buildroot
mkdir -p $(STAGING)/plugins
cp /plugins/$(APP_NAME)/*.whl $(STAGING)/plugins
cp /plugins/*.whl $(STAGING)/plugins
# Prepare staging for fluxcd package
cp -R fluxcd-manifests $(STAGING)/