From 809cdf6206ba896110164012783dab3ec5fa068b Mon Sep 17 00:00:00 2001 From: Leonardo Fagundes Luz Serrano Date: Wed, 21 Dec 2022 06:47:46 -0300 Subject: [PATCH] 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- - Standardized plugin debian files (rules, *.install) - Plugin wheels saved to /plugin instead of /plugin/ 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 Change-Id: I9f5e8b1afc65de3b7d7ee05744ad39f5acc834de --- .zuul.yaml | 8 ++--- debian_pkg_dirs | 2 +- .../python3-k8sapp-vault-wheels.install | 1 - .../deb_folder/python3-k8sapp-vault.install | 2 -- python-k8sapp-vault/debian/deb_folder/rules | 26 --------------- .../debian/deb_folder/changelog | 0 .../debian/deb_folder/control | 0 .../debian/deb_folder/copyright | 0 .../python3-k8sapp-vault-wheels.install | 1 + .../deb_folder/python3-k8sapp-vault.install | 1 + python3-k8sapp-vault/debian/deb_folder/rules | 33 +++++++++++++++++++ .../debian/deb_folder/source/format | 0 .../debian/meta_data.yaml | 0 .../k8sapp_vault/.gitignore | 0 .../k8sapp_vault/.stestr.conf | 0 .../k8sapp_vault/LICENSE | 0 .../k8sapp_vault/README.rst | 0 .../k8sapp_vault/k8sapp_vault/__init__.py | 0 .../k8sapp_vault/armada/__init__.py | 0 .../k8sapp_vault/armada/manifest_vault.py | 0 .../k8sapp_vault/common/__init__.py | 0 .../k8sapp_vault/common/constants.py | 0 .../k8sapp_vault/helm/__init__.py | 0 .../k8sapp_vault/helm/psp_rolebinding.py | 0 .../k8sapp_vault/k8sapp_vault/helm/vault.py | 0 .../k8sapp_vault/tests/__init__.py | 0 .../k8sapp_vault/tests/test_plugins.py | 0 .../k8sapp_vault/tests/test_vault.py | 0 .../k8sapp_vault/pylint.rc | 0 .../k8sapp_vault/requirements.txt | 0 .../k8sapp_vault/setup.cfg | 2 +- .../k8sapp_vault/setup.py | 0 .../k8sapp_vault/test-requirements.txt | 0 .../k8sapp_vault/tox.ini | 0 .../k8sapp_vault/upper-constraints.txt | 0 stx-vault-helm/debian/deb_folder/rules | 2 +- 36 files changed, 42 insertions(+), 36 deletions(-) delete mode 100644 python-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault-wheels.install delete mode 100644 python-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault.install delete mode 100755 python-k8sapp-vault/debian/deb_folder/rules rename {python-k8sapp-vault => python3-k8sapp-vault}/debian/deb_folder/changelog (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/debian/deb_folder/control (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/debian/deb_folder/copyright (100%) create mode 100644 python3-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault-wheels.install create mode 100644 python3-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault.install create mode 100755 python3-k8sapp-vault/debian/deb_folder/rules rename {python-k8sapp-vault => python3-k8sapp-vault}/debian/deb_folder/source/format (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/debian/meta_data.yaml (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/.gitignore (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/.stestr.conf (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/LICENSE (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/README.rst (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/__init__.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/armada/__init__.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/armada/manifest_vault.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/common/__init__.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/common/constants.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/helm/__init__.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/helm/psp_rolebinding.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/helm/vault.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/tests/__init__.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/tests/test_plugins.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/k8sapp_vault/tests/test_vault.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/pylint.rc (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/requirements.txt (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/setup.cfg (98%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/setup.py (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/test-requirements.txt (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/tox.ini (100%) rename {python-k8sapp-vault => python3-k8sapp-vault}/k8sapp_vault/upper-constraints.txt (100%) diff --git a/.zuul.yaml b/.zuul.yaml index b0cd51d..dbbffc9 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -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 diff --git a/debian_pkg_dirs b/debian_pkg_dirs index 689c7dd..9657941 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -1,3 +1,3 @@ -python-k8sapp-vault +python3-k8sapp-vault stx-vault-helm vault-helm diff --git a/python-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault-wheels.install b/python-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault-wheels.install deleted file mode 100644 index 4ce58ea..0000000 --- a/python-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault-wheels.install +++ /dev/null @@ -1 +0,0 @@ -plugins/vault/*.whl diff --git a/python-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault.install b/python-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault.install deleted file mode 100644 index a54be94..0000000 --- a/python-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/python3/dist-packages/k8sapp_vault-1.0.0.egg-info/* -usr/lib/python3/dist-packages/k8sapp_vault/* \ No newline at end of file diff --git a/python-k8sapp-vault/debian/deb_folder/rules b/python-k8sapp-vault/debian/deb_folder/rules deleted file mode 100755 index 1ab9ba7..0000000 --- a/python-k8sapp-vault/debian/deb_folder/rules +++ /dev/null @@ -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 diff --git a/python-k8sapp-vault/debian/deb_folder/changelog b/python3-k8sapp-vault/debian/deb_folder/changelog similarity index 100% rename from python-k8sapp-vault/debian/deb_folder/changelog rename to python3-k8sapp-vault/debian/deb_folder/changelog diff --git a/python-k8sapp-vault/debian/deb_folder/control b/python3-k8sapp-vault/debian/deb_folder/control similarity index 100% rename from python-k8sapp-vault/debian/deb_folder/control rename to python3-k8sapp-vault/debian/deb_folder/control diff --git a/python-k8sapp-vault/debian/deb_folder/copyright b/python3-k8sapp-vault/debian/deb_folder/copyright similarity index 100% rename from python-k8sapp-vault/debian/deb_folder/copyright rename to python3-k8sapp-vault/debian/deb_folder/copyright diff --git a/python3-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault-wheels.install b/python3-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault-wheels.install new file mode 100644 index 0000000..19a9e4c --- /dev/null +++ b/python3-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault-wheels.install @@ -0,0 +1 @@ +plugins/*.whl diff --git a/python3-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault.install b/python3-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault.install new file mode 100644 index 0000000..91d1d9d --- /dev/null +++ b/python3-k8sapp-vault/debian/deb_folder/python3-k8sapp-vault.install @@ -0,0 +1 @@ +usr/lib/python3/dist-packages/k8sapp_* diff --git a/python3-k8sapp-vault/debian/deb_folder/rules b/python3-k8sapp-vault/debian/deb_folder/rules new file mode 100755 index 0000000..e3c856e --- /dev/null +++ b/python3-k8sapp-vault/debian/deb_folder/rules @@ -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 diff --git a/python-k8sapp-vault/debian/deb_folder/source/format b/python3-k8sapp-vault/debian/deb_folder/source/format similarity index 100% rename from python-k8sapp-vault/debian/deb_folder/source/format rename to python3-k8sapp-vault/debian/deb_folder/source/format diff --git a/python-k8sapp-vault/debian/meta_data.yaml b/python3-k8sapp-vault/debian/meta_data.yaml similarity index 100% rename from python-k8sapp-vault/debian/meta_data.yaml rename to python3-k8sapp-vault/debian/meta_data.yaml diff --git a/python-k8sapp-vault/k8sapp_vault/.gitignore b/python3-k8sapp-vault/k8sapp_vault/.gitignore similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/.gitignore rename to python3-k8sapp-vault/k8sapp_vault/.gitignore diff --git a/python-k8sapp-vault/k8sapp_vault/.stestr.conf b/python3-k8sapp-vault/k8sapp_vault/.stestr.conf similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/.stestr.conf rename to python3-k8sapp-vault/k8sapp_vault/.stestr.conf diff --git a/python-k8sapp-vault/k8sapp_vault/LICENSE b/python3-k8sapp-vault/k8sapp_vault/LICENSE similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/LICENSE rename to python3-k8sapp-vault/k8sapp_vault/LICENSE diff --git a/python-k8sapp-vault/k8sapp_vault/README.rst b/python3-k8sapp-vault/k8sapp_vault/README.rst similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/README.rst rename to python3-k8sapp-vault/k8sapp_vault/README.rst diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/__init__.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/__init__.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/__init__.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/__init__.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/armada/__init__.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/armada/__init__.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/armada/__init__.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/armada/__init__.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/armada/manifest_vault.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/armada/manifest_vault.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/armada/manifest_vault.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/armada/manifest_vault.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/common/__init__.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/common/__init__.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/common/__init__.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/common/__init__.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/common/constants.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/common/constants.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/common/constants.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/common/constants.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/__init__.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/__init__.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/__init__.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/__init__.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/psp_rolebinding.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/psp_rolebinding.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/psp_rolebinding.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/psp_rolebinding.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/vault.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/vault.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/vault.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/helm/vault.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/__init__.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/__init__.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/__init__.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/__init__.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/test_plugins.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/test_plugins.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/test_plugins.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/test_plugins.py diff --git a/python-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/test_vault.py b/python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/test_vault.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/test_vault.py rename to python3-k8sapp-vault/k8sapp_vault/k8sapp_vault/tests/test_vault.py diff --git a/python-k8sapp-vault/k8sapp_vault/pylint.rc b/python3-k8sapp-vault/k8sapp_vault/pylint.rc similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/pylint.rc rename to python3-k8sapp-vault/k8sapp_vault/pylint.rc diff --git a/python-k8sapp-vault/k8sapp_vault/requirements.txt b/python3-k8sapp-vault/k8sapp_vault/requirements.txt similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/requirements.txt rename to python3-k8sapp-vault/k8sapp_vault/requirements.txt diff --git a/python-k8sapp-vault/k8sapp_vault/setup.cfg b/python3-k8sapp-vault/k8sapp_vault/setup.cfg similarity index 98% rename from python-k8sapp-vault/k8sapp_vault/setup.cfg rename to python3-k8sapp-vault/k8sapp_vault/setup.cfg index e4c4cd3..d94be0d 100644 --- a/python-k8sapp-vault/k8sapp_vault/setup.cfg +++ b/python3-k8sapp-vault/k8sapp_vault/setup.cfg @@ -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 diff --git a/python-k8sapp-vault/k8sapp_vault/setup.py b/python3-k8sapp-vault/k8sapp_vault/setup.py similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/setup.py rename to python3-k8sapp-vault/k8sapp_vault/setup.py diff --git a/python-k8sapp-vault/k8sapp_vault/test-requirements.txt b/python3-k8sapp-vault/k8sapp_vault/test-requirements.txt similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/test-requirements.txt rename to python3-k8sapp-vault/k8sapp_vault/test-requirements.txt diff --git a/python-k8sapp-vault/k8sapp_vault/tox.ini b/python3-k8sapp-vault/k8sapp_vault/tox.ini similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/tox.ini rename to python3-k8sapp-vault/k8sapp_vault/tox.ini diff --git a/python-k8sapp-vault/k8sapp_vault/upper-constraints.txt b/python3-k8sapp-vault/k8sapp_vault/upper-constraints.txt similarity index 100% rename from python-k8sapp-vault/k8sapp_vault/upper-constraints.txt rename to python3-k8sapp-vault/k8sapp_vault/upper-constraints.txt diff --git a/stx-vault-helm/debian/deb_folder/rules b/stx-vault-helm/debian/deb_folder/rules index d550dd4..d5f2b5c 100755 --- a/stx-vault-helm/debian/deb_folder/rules +++ b/stx-vault-helm/debian/deb_folder/rules @@ -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)/