From 6c326126860dce3fa6e63e6baafec5ab58780284 Mon Sep 17 00:00:00 2001 From: Leonardo Fagundes Luz Serrano Date: Wed, 21 Dec 2022 06:40:34 -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 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 Story: 2010542 Task: 47197 Signed-off-by: Leonardo Fagundes Luz Serrano Change-Id: I099f6e68145750f429a7c95ed200b6abf4649061 --- .zuul.yaml | 16 ++-- centos_build_layer.cfg | 1 - centos_iso_image.inc | 1 - centos_pkg_dirs | 2 - centos_pkg_dirs_containers | 2 - centos_stable_docker_images.inc | 1 - debian_pkg_dirs | 3 +- python-k8sapp-auditd/centos/build_srpm.data | 9 -- .../centos/python-k8sapp-audit.spec | 52 ----------- .../python3-k8sapp-auditd-wheels.install | 1 - .../deb_folder/python3-k8sapp-auditd.install | 2 - python-k8sapp-auditd/debian/deb_folder/rules | 26 ------ python-k8sapp-auditd/debian/meta_data.yaml | 7 -- .../debian/deb_folder/changelog | 0 .../debian/deb_folder/control | 0 .../debian/deb_folder/copyright | 0 .../python3-k8sapp-auditd-wheels.install | 1 + .../deb_folder/python3-k8sapp-auditd.install | 1 + python3-k8sapp-auditd/debian/deb_folder/rules | 33 +++++++ .../debian/deb_folder/source/format | 0 python3-k8sapp-auditd/debian/meta_data.yaml | 9 ++ .../k8sapp_auditd/.gitignore | 0 .../k8sapp_auditd/.stestr.conf | 0 .../k8sapp_auditd/LICENSE | 0 .../k8sapp_auditd/README.rst | 0 .../k8sapp_auditd/k8sapp_auditd/__init__.py | 0 .../k8sapp_auditd/common/__init__.py | 0 .../k8sapp_auditd/common/constants.py | 0 .../k8sapp_auditd/helm/__init__.py | 0 .../k8sapp_auditd/helm/auditd.py | 0 .../k8sapp_auditd/tests/__init__.py | 0 .../k8sapp_auditd/tests/test_auditd.py | 0 .../k8sapp_auditd/tests/test_plugins.py | 0 .../k8sapp_auditd/pylint.rc | 0 .../k8sapp_auditd/requirements.txt | 0 .../k8sapp_auditd/setup.cfg | 2 +- .../k8sapp_auditd/setup.py | 0 .../k8sapp_auditd/test-requirements.txt | 0 .../k8sapp_auditd/tox.ini | 0 .../k8sapp_auditd/upper-constraints.txt | 0 stx-audit-helm/centos/build_srpm.data | 6 -- .../centos/docker/stx-audit/Dockerfile | 14 --- .../centos/docker/stx-audit/startAuditd.sh | 26 ------ stx-audit-helm/centos/stx-audit-helm.spec | 87 ------------------- .../stx-snmp-helm-audit.stable_docker_image | 3 - stx-audit-helm/debian/deb_folder/rules | 2 +- stx-audit-helm/debian/meta_data.yaml | 4 +- 47 files changed, 58 insertions(+), 253 deletions(-) delete mode 100644 centos_build_layer.cfg delete mode 100644 centos_iso_image.inc delete mode 100644 centos_pkg_dirs delete mode 100644 centos_pkg_dirs_containers delete mode 100644 centos_stable_docker_images.inc delete mode 100644 python-k8sapp-auditd/centos/build_srpm.data delete mode 100644 python-k8sapp-auditd/centos/python-k8sapp-audit.spec delete mode 100644 python-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd-wheels.install delete mode 100644 python-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd.install delete mode 100755 python-k8sapp-auditd/debian/deb_folder/rules delete mode 100644 python-k8sapp-auditd/debian/meta_data.yaml rename {python-k8sapp-auditd => python3-k8sapp-auditd}/debian/deb_folder/changelog (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/debian/deb_folder/control (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/debian/deb_folder/copyright (100%) create mode 100644 python3-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd-wheels.install create mode 100644 python3-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd.install create mode 100755 python3-k8sapp-auditd/debian/deb_folder/rules rename {python-k8sapp-auditd => python3-k8sapp-auditd}/debian/deb_folder/source/format (100%) create mode 100644 python3-k8sapp-auditd/debian/meta_data.yaml rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/.gitignore (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/.stestr.conf (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/LICENSE (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/README.rst (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/k8sapp_auditd/__init__.py (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/k8sapp_auditd/common/__init__.py (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/k8sapp_auditd/common/constants.py (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/k8sapp_auditd/helm/__init__.py (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/k8sapp_auditd/helm/auditd.py (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/k8sapp_auditd/tests/__init__.py (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/k8sapp_auditd/tests/test_auditd.py (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/k8sapp_auditd/tests/test_plugins.py (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/pylint.rc (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/requirements.txt (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/setup.cfg (98%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/setup.py (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/test-requirements.txt (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/tox.ini (100%) rename {python-k8sapp-auditd => python3-k8sapp-auditd}/k8sapp_auditd/upper-constraints.txt (100%) delete mode 100644 stx-audit-helm/centos/build_srpm.data delete mode 100644 stx-audit-helm/centos/docker/stx-audit/Dockerfile delete mode 100644 stx-audit-helm/centos/docker/stx-audit/startAuditd.sh delete mode 100644 stx-audit-helm/centos/stx-audit-helm.spec delete mode 100755 stx-audit-helm/centos/stx-snmp-helm-audit.stable_docker_image diff --git a/.zuul.yaml b/.zuul.yaml index 324bb49..537e7a1 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -29,11 +29,11 @@ - starlingx/update - starlingx/utilities files: - - python-k8sapp-auditd/* + - python3-k8sapp-auditd/* vars: tox_envlist: py39 python_version: 3.9 - tox_extra_args: -c python-k8sapp-auditd/k8sapp_auditd/tox.ini + tox_extra_args: -c python3-k8sapp-auditd/k8sapp_auditd/tox.ini - job: name: k8sapp-auditd-tox-flake8 @@ -42,10 +42,10 @@ Run flake8 test for k8sapp_auditd nodeset: ubuntu-bionic files: - - python-k8sapp-auditd/* + - python3-k8sapp-auditd/* vars: tox_envlist: flake8 - tox_extra_args: -c python-k8sapp-auditd/k8sapp_auditd/tox.ini + tox_extra_args: -c python3-k8sapp-auditd/k8sapp_auditd/tox.ini - job: name: k8sapp-auditd-tox-pylint parent: tox @@ -58,10 +58,10 @@ - starlingx/update - starlingx/utilities files: - - python-k8sapp-auditd/* + - python3-k8sapp-auditd/* vars: tox_envlist: pylint - tox_extra_args: -c python-k8sapp-auditd/k8sapp_auditd/tox.ini + tox_extra_args: -c python3-k8sapp-auditd/k8sapp_auditd/tox.ini - job: name: k8sapp-auditd-tox-bandit parent: tox @@ -69,7 +69,7 @@ Run bandit test for k8sapp_auditd nodeset: ubuntu-bionic files: - - python-k8sapp-auditd/* + - python3-k8sapp-auditd/* vars: tox_envlist: bandit - tox_extra_args: -c python-k8sapp-auditd/k8sapp_auditd/tox.ini + tox_extra_args: -c python3-k8sapp-auditd/k8sapp_auditd/tox.ini diff --git a/centos_build_layer.cfg b/centos_build_layer.cfg deleted file mode 100644 index c581999..0000000 --- a/centos_build_layer.cfg +++ /dev/null @@ -1 +0,0 @@ -flock diff --git a/centos_iso_image.inc b/centos_iso_image.inc deleted file mode 100644 index cc62b53..0000000 --- a/centos_iso_image.inc +++ /dev/null @@ -1 +0,0 @@ -stx-audit-helm diff --git a/centos_pkg_dirs b/centos_pkg_dirs deleted file mode 100644 index 45cb1d2..0000000 --- a/centos_pkg_dirs +++ /dev/null @@ -1,2 +0,0 @@ -stx-audit-helm -python-k8sapp-auditd \ No newline at end of file diff --git a/centos_pkg_dirs_containers b/centos_pkg_dirs_containers deleted file mode 100644 index 45cb1d2..0000000 --- a/centos_pkg_dirs_containers +++ /dev/null @@ -1,2 +0,0 @@ -stx-audit-helm -python-k8sapp-auditd \ No newline at end of file diff --git a/centos_stable_docker_images.inc b/centos_stable_docker_images.inc deleted file mode 100644 index cc62b53..0000000 --- a/centos_stable_docker_images.inc +++ /dev/null @@ -1 +0,0 @@ -stx-audit-helm diff --git a/debian_pkg_dirs b/debian_pkg_dirs index 98a6123..4a12ac7 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -1,3 +1,2 @@ -python-k8sapp-auditd +python3-k8sapp-auditd stx-audit-helm - diff --git a/python-k8sapp-auditd/centos/build_srpm.data b/python-k8sapp-auditd/centos/build_srpm.data deleted file mode 100644 index bcf4e1c..0000000 --- a/python-k8sapp-auditd/centos/build_srpm.data +++ /dev/null @@ -1,9 +0,0 @@ -SRC_DIR="k8sapp_auditd" -OPT_DEP_LIST="$STX_BASE/audit-armada-app/stx-audit-helm" - -TIS_PATCH_VER=GITREVCOUNT - -# Keep the SRCREV in sync with stx-auditd-helm so the app version is the same -# as the plugin version - -TIS_BASE_SRCREV=eeb94bddc8c4c6e513adfae5505e174e0445deed \ No newline at end of file diff --git a/python-k8sapp-auditd/centos/python-k8sapp-audit.spec b/python-k8sapp-auditd/centos/python-k8sapp-audit.spec deleted file mode 100644 index eb9bf5a..0000000 --- a/python-k8sapp-auditd/centos/python-k8sapp-audit.spec +++ /dev/null @@ -1,52 +0,0 @@ -%global app_name auditd -%global pypi_name k8sapp-auditd -%global sname k8sapp_auditd - -Name: python-%{pypi_name} -Version: 1.0 -Release: %{tis_patch_ver}%{?_tis_dist} -Summary: StarlingX sysinv extensions: Auditd - -License: Apache-2.0 -Source0: %{name}-%{version}.tar.gz - -BuildArch: noarch - -BuildRequires: python-setuptools -BuildRequires: python-pbr -BuildRequires: python2-pip -BuildRequires: python2-wheel - -%description -StarlingX sysinv extensions: AUDITD K8S app - -%prep -%setup -# Remove bundled egg-info -rm -rf %{pypi_name}.egg-info - -%build -export PBR_VERSION=%{version} -%{__python2} setup.py build - -%py2_build_wheel - -%install -export PBR_VERSION=%{version}.%{tis_patch_ver} -export SKIP_PIP_INSTALL=1 -%{__python2} setup.py install --skip-build --root %{buildroot} -mkdir -p ${RPM_BUILD_ROOT}/plugins/%{app_name} -install -m 644 dist/*.whl ${RPM_BUILD_ROOT}/plugins/%{app_name}/ - -%files -%{python2_sitelib}/%{sname} -%{python2_sitelib}/%{sname}-*.egg-info - -%package wheels -Summary: %{name} wheels - -%description wheels -Contains python wheels for %{name} - -%files wheels -/plugins/* diff --git a/python-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd-wheels.install b/python-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd-wheels.install deleted file mode 100644 index c9c6f74..0000000 --- a/python-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd-wheels.install +++ /dev/null @@ -1 +0,0 @@ -plugins/auditd/*.whl diff --git a/python-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd.install b/python-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd.install deleted file mode 100644 index 7ac83d3..0000000 --- a/python-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/python3/dist-packages/k8sapp_auditd-1.0.0.egg-info/* -usr/lib/python3/dist-packages/k8sapp_auditd/* diff --git a/python-k8sapp-auditd/debian/deb_folder/rules b/python-k8sapp-auditd/debian/deb_folder/rules deleted file mode 100755 index ba6bf36..0000000 --- a/python-k8sapp-auditd/debian/deb_folder/rules +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/make -f -# export DH_VERBOSE = 1 - -export APP_NAME=auditd -export PBR_VERSION=1.0.0 -export PYBUILD_NAME=k8sapp-auditd -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 diff --git a/python-k8sapp-auditd/debian/meta_data.yaml b/python-k8sapp-auditd/debian/meta_data.yaml deleted file mode 100644 index af3aab8..0000000 --- a/python-k8sapp-auditd/debian/meta_data.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -debname: python3-k8sapp-auditd -debver: 1.0-1 -src_path: k8sapp_auditd -revision: - dist: $STX_DIST - PKG_GITREVCOUNT: true diff --git a/python-k8sapp-auditd/debian/deb_folder/changelog b/python3-k8sapp-auditd/debian/deb_folder/changelog similarity index 100% rename from python-k8sapp-auditd/debian/deb_folder/changelog rename to python3-k8sapp-auditd/debian/deb_folder/changelog diff --git a/python-k8sapp-auditd/debian/deb_folder/control b/python3-k8sapp-auditd/debian/deb_folder/control similarity index 100% rename from python-k8sapp-auditd/debian/deb_folder/control rename to python3-k8sapp-auditd/debian/deb_folder/control diff --git a/python-k8sapp-auditd/debian/deb_folder/copyright b/python3-k8sapp-auditd/debian/deb_folder/copyright similarity index 100% rename from python-k8sapp-auditd/debian/deb_folder/copyright rename to python3-k8sapp-auditd/debian/deb_folder/copyright diff --git a/python3-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd-wheels.install b/python3-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd-wheels.install new file mode 100644 index 0000000..19a9e4c --- /dev/null +++ b/python3-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd-wheels.install @@ -0,0 +1 @@ +plugins/*.whl diff --git a/python3-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd.install b/python3-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd.install new file mode 100644 index 0000000..91d1d9d --- /dev/null +++ b/python3-k8sapp-auditd/debian/deb_folder/python3-k8sapp-auditd.install @@ -0,0 +1 @@ +usr/lib/python3/dist-packages/k8sapp_* diff --git a/python3-k8sapp-auditd/debian/deb_folder/rules b/python3-k8sapp-auditd/debian/deb_folder/rules new file mode 100755 index 0000000..6129fd7 --- /dev/null +++ b/python3-k8sapp-auditd/debian/deb_folder/rules @@ -0,0 +1,33 @@ +#!/usr/bin/make -f +# export DH_VERBOSE = 1 + +export APP_NAME = auditd +export PYBUILD_NAME = k8sapp-auditd + +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-auditd/debian/deb_folder/source/format b/python3-k8sapp-auditd/debian/deb_folder/source/format similarity index 100% rename from python-k8sapp-auditd/debian/deb_folder/source/format rename to python3-k8sapp-auditd/debian/deb_folder/source/format diff --git a/python3-k8sapp-auditd/debian/meta_data.yaml b/python3-k8sapp-auditd/debian/meta_data.yaml new file mode 100644 index 0000000..f38694d --- /dev/null +++ b/python3-k8sapp-auditd/debian/meta_data.yaml @@ -0,0 +1,9 @@ +--- +debname: python3-k8sapp-auditd +debver: 1.0-1 +src_path: k8sapp_auditd +revision: + dist: $STX_DIST + GITREVCOUNT: + SRC_DIR: ${MY_REPO}/stx/audit-armada-app + BASE_SRCREV: eeb94bddc8c4c6e513adfae5505e174e0445deed diff --git a/python-k8sapp-auditd/k8sapp_auditd/.gitignore b/python3-k8sapp-auditd/k8sapp_auditd/.gitignore similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/.gitignore rename to python3-k8sapp-auditd/k8sapp_auditd/.gitignore diff --git a/python-k8sapp-auditd/k8sapp_auditd/.stestr.conf b/python3-k8sapp-auditd/k8sapp_auditd/.stestr.conf similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/.stestr.conf rename to python3-k8sapp-auditd/k8sapp_auditd/.stestr.conf diff --git a/python-k8sapp-auditd/k8sapp_auditd/LICENSE b/python3-k8sapp-auditd/k8sapp_auditd/LICENSE similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/LICENSE rename to python3-k8sapp-auditd/k8sapp_auditd/LICENSE diff --git a/python-k8sapp-auditd/k8sapp_auditd/README.rst b/python3-k8sapp-auditd/k8sapp_auditd/README.rst similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/README.rst rename to python3-k8sapp-auditd/k8sapp_auditd/README.rst diff --git a/python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/__init__.py b/python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/__init__.py similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/__init__.py rename to python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/__init__.py diff --git a/python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/common/__init__.py b/python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/common/__init__.py similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/common/__init__.py rename to python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/common/__init__.py diff --git a/python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/common/constants.py b/python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/common/constants.py similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/common/constants.py rename to python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/common/constants.py diff --git a/python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/helm/__init__.py b/python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/helm/__init__.py similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/helm/__init__.py rename to python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/helm/__init__.py diff --git a/python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/helm/auditd.py b/python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/helm/auditd.py similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/helm/auditd.py rename to python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/helm/auditd.py diff --git a/python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/__init__.py b/python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/__init__.py similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/__init__.py rename to python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/__init__.py diff --git a/python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/test_auditd.py b/python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/test_auditd.py similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/test_auditd.py rename to python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/test_auditd.py diff --git a/python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/test_plugins.py b/python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/test_plugins.py similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/test_plugins.py rename to python3-k8sapp-auditd/k8sapp_auditd/k8sapp_auditd/tests/test_plugins.py diff --git a/python-k8sapp-auditd/k8sapp_auditd/pylint.rc b/python3-k8sapp-auditd/k8sapp_auditd/pylint.rc similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/pylint.rc rename to python3-k8sapp-auditd/k8sapp_auditd/pylint.rc diff --git a/python-k8sapp-auditd/k8sapp_auditd/requirements.txt b/python3-k8sapp-auditd/k8sapp_auditd/requirements.txt similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/requirements.txt rename to python3-k8sapp-auditd/k8sapp_auditd/requirements.txt diff --git a/python-k8sapp-auditd/k8sapp_auditd/setup.cfg b/python3-k8sapp-auditd/k8sapp_auditd/setup.cfg similarity index 98% rename from python-k8sapp-auditd/k8sapp_auditd/setup.cfg rename to python3-k8sapp-auditd/k8sapp_auditd/setup.cfg index 9300e44..ec62d5c 100644 --- a/python-k8sapp-auditd/k8sapp_auditd/setup.cfg +++ b/python3-k8sapp-auditd/k8sapp_auditd/setup.cfg @@ -33,5 +33,5 @@ systemconfig.helm_applications = systemconfig.helm_plugins.auditd = 001_auditd = k8sapp_auditd.helm.auditd:AuditdHelm -[wheel] +[bdist_wheel] universal = 1 diff --git a/python-k8sapp-auditd/k8sapp_auditd/setup.py b/python3-k8sapp-auditd/k8sapp_auditd/setup.py similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/setup.py rename to python3-k8sapp-auditd/k8sapp_auditd/setup.py diff --git a/python-k8sapp-auditd/k8sapp_auditd/test-requirements.txt b/python3-k8sapp-auditd/k8sapp_auditd/test-requirements.txt similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/test-requirements.txt rename to python3-k8sapp-auditd/k8sapp_auditd/test-requirements.txt diff --git a/python-k8sapp-auditd/k8sapp_auditd/tox.ini b/python3-k8sapp-auditd/k8sapp_auditd/tox.ini similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/tox.ini rename to python3-k8sapp-auditd/k8sapp_auditd/tox.ini diff --git a/python-k8sapp-auditd/k8sapp_auditd/upper-constraints.txt b/python3-k8sapp-auditd/k8sapp_auditd/upper-constraints.txt similarity index 100% rename from python-k8sapp-auditd/k8sapp_auditd/upper-constraints.txt rename to python3-k8sapp-auditd/k8sapp_auditd/upper-constraints.txt diff --git a/stx-audit-helm/centos/build_srpm.data b/stx-audit-helm/centos/build_srpm.data deleted file mode 100644 index 1422f18..0000000 --- a/stx-audit-helm/centos/build_srpm.data +++ /dev/null @@ -1,6 +0,0 @@ -SRC_DIR="stx-audit-helm" -OPT_DEP_LIST="$STX_BASE/audit-armada-app/python-k8sapp-auditd" - -TIS_PATCH_VER=GITREVCOUNT - -TIS_BASE_SRCREV=eeb94bddc8c4c6e513adfae5505e174e0445deed diff --git a/stx-audit-helm/centos/docker/stx-audit/Dockerfile b/stx-audit-helm/centos/docker/stx-audit/Dockerfile deleted file mode 100644 index 29934a2..0000000 --- a/stx-audit-helm/centos/docker/stx-audit/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -ARG BASE -FROM ${BASE} AS stx -RUN yum -y update -RUN yum -y install\ - audit - -COPY startAuditd.sh . - -RUN mkdir -p /etc/audit -RUN touch /etc/audit/audit.rules -RUN chmod 600 /etc/audit/audit.rules - -RUN chmod 755 startAuditd.sh -ENTRYPOINT ["./startAuditd.sh"] \ No newline at end of file diff --git a/stx-audit-helm/centos/docker/stx-audit/startAuditd.sh b/stx-audit-helm/centos/docker/stx-audit/startAuditd.sh deleted file mode 100644 index b0e0822..0000000 --- a/stx-audit-helm/centos/docker/stx-audit/startAuditd.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# -# Copyright (c) 2021 Wind River Systems, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# - -set -u - -echo "Starting auditd …" - -# update /etc/audit/audit.rules with any changes made to -# /etc/audit/rules.d/audit.rules -augenrules --load - -# start auditd with no fork to run in the background in the container -/sbin/auditd -n -l -EXIT_STATUS=$? - -if [ "$EXIT_STATUS" -ne "0" ]; then - echo "Error code: $EXIT_STATUS" - echo "Could not start auditd" >&2 -fi - -exit ${EXIT_STATUS} diff --git a/stx-audit-helm/centos/stx-audit-helm.spec b/stx-audit-helm/centos/stx-audit-helm.spec deleted file mode 100644 index 021c083..0000000 --- a/stx-audit-helm/centos/stx-audit-helm.spec +++ /dev/null @@ -1,87 +0,0 @@ -# -# Copyright (c) 2021-2022 Wind River Systems, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# -# Application tunables (maps to metadata) -%global app_name auditd -%global helm_repo stx-platform - - -# Install location -%global app_folder /usr/local/share/applications/helm - -# Build variables -%global helm_folder /usr/lib/helm -%global toolkit_version 0.1.0 - -Summary: StarlingX AUDITD FluxCD Helm Charts -Name: stx-audit-helm -Version: 1.0 -Release: %{tis_patch_ver}%{?_tis_dist} -License: Apache-2.0 -Group: base -Packager: Wind River -URL: unknown - -Source0: %{name}-%{version}.tar.gz - -BuildArch: noarch - -BuildRequires: helm -BuildRequires: python-k8sapp-auditd -BuildRequires: python-k8sapp-auditd-wheels - -%description -StarlingX AUDITD Helm Charts - -%prep -%setup -n %{name}-%{version} - -%build - -cd helm-charts -make -cd - - -# Create a chart tarball compliant with sysinv kube-app.py -%define app_staging %{_builddir}/staging -%define app_tarball_fluxcd %{app_name}-%{version}-%{tis_patch_ver}.tgz - -# Setup staging -mkdir -p %{app_staging} -cp files/metadata.yaml %{app_staging} -mkdir -p %{app_staging}/charts -cp helm-charts/*.tgz %{app_staging}/charts - -# Populate metadata -sed -i 's/@APP_NAME@/%{app_name}/g' %{app_staging}/metadata.yaml -sed -i 's/@APP_VERSION@/%{version}-%{tis_patch_ver}/g' %{app_staging}/metadata.yaml -sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml - -# Copy the plugins: installed in the buildroot -mkdir -p %{app_staging}/plugins -cp /plugins/%{app_name}/*.whl %{app_staging}/plugins - -cp -R fluxcd-manifests %{app_staging}/ - -# calculate checksum of all files in app_staging -cd %{app_staging} -find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5 -tar -zcf %{_builddir}/%{app_tarball_fluxcd} -C %{app_staging}/ . - -cd - - -# Cleanup staging -rm -fr %{app_staging} - -%install -install -d -m 755 %{buildroot}/%{app_folder} -install -p -D -m 755 %{_builddir}/%{app_tarball_fluxcd} %{buildroot}/%{app_folder} -install -m 644 -p -D files/auditd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/auditd.logrotate - -%files -%defattr(-,root,root,-) -%{app_folder}/%{app_tarball_fluxcd} -# logfile config files -%{_sysconfdir}/logrotate.d/auditd.logrotate diff --git a/stx-audit-helm/centos/stx-snmp-helm-audit.stable_docker_image b/stx-audit-helm/centos/stx-snmp-helm-audit.stable_docker_image deleted file mode 100755 index 8501dcb..0000000 --- a/stx-audit-helm/centos/stx-snmp-helm-audit.stable_docker_image +++ /dev/null @@ -1,3 +0,0 @@ -BUILDER=docker -LABEL=stx-audit -DOCKER_CONTEXT=docker/stx-audit diff --git a/stx-audit-helm/debian/deb_folder/rules b/stx-audit-helm/debian/deb_folder/rules index e98b1a7..1642590 100755 --- a/stx-audit-helm/debian/deb_folder/rules +++ b/stx-audit-helm/debian/deb_folder/rules @@ -34,7 +34,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 # package fluxcd cp -R fluxcd-manifests $(STAGING)/ diff --git a/stx-audit-helm/debian/meta_data.yaml b/stx-audit-helm/debian/meta_data.yaml index fba5265..f03298a 100644 --- a/stx-audit-helm/debian/meta_data.yaml +++ b/stx-audit-helm/debian/meta_data.yaml @@ -4,4 +4,6 @@ debver: 1.0-1 src_path: stx-audit-helm revision: dist: $STX_DIST - PKG_GITREVCOUNT: true + GITREVCOUNT: + SRC_DIR: ${MY_REPO}/stx/audit-armada-app + BASE_SRCREV: eeb94bddc8c4c6e513adfae5505e174e0445deed