Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-129378 / 24.10 / Add debian package for apps_validation #20

Merged
merged 6 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on: [push]

jobs:
build-deb:
runs-on: ubuntu-latest
container:
image: ghcr.io/truenas/apps_validation:latest

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install Deps
run: sudo apt update && sudo apt install -y python3-git python3-jinja2
- name: Build deb package
run: >
dpkg-buildpackage
-B
--no-sign
-jauto

- name: Create artifacts dir
run: mkdir artifacts
if: success()

- name: Move artifacts
run: mv ../*.deb artifacts
if: success()

- uses: actions/upload-artifact@v1
with:
name: py-apps-validation
path: artifacts
if: success()
9 changes: 2 additions & 7 deletions catalog_reader/scripts/apps_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import argparse
import os
import pathlib
import ruamel.yaml
import shutil
import yaml

Expand All @@ -12,10 +11,6 @@
from catalog_reader.names import get_library_path, get_library_hashes_path, get_base_library_dir_name_from_version


YAML = ruamel.yaml.YAML()
YAML.indent(mapping=2, sequence=4, offset=2)


def update_catalog_hashes(catalog_path: str) -> None:
if not os.path.exists(catalog_path):
raise CatalogDoesNotExist(catalog_path)
Expand Down Expand Up @@ -54,7 +49,7 @@ def update_catalog_hashes(catalog_path: str) -> None:
continue

with open(str(app_metadata_file), 'r') as f:
app_config = YAML.load(f)
app_config = yaml.safe_load(f.read())

if (lib_version := app_config.get('lib_version')) and lib_version not in hashes:
print(
Expand All @@ -74,7 +69,7 @@ def update_catalog_hashes(catalog_path: str) -> None:

app_config['lib_version_hash'] = hashes[lib_version]
with open(str(app_metadata_file), 'w') as f:
YAML.dump(app_config, f)
yaml.safe_dump(app_config)

print(f'[\033[92mOK\x1B[0m]\tUpdated library hash for {app_dir.name!r} in {train_dir.name}')

Expand Down
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apps-validation (0.1-0~truenas+1) bullseye-truenas-unstable; urgency=medium

* Initial release

-- Waqar Ahmed <[email protected]> Fri, 2 Jun 2024 00:26:21 +0500
31 changes: 31 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Source: apps-validation
Section: contrib/python
Priority: optional
Maintainer: Waqar Ahmed <[email protected]>
Build-Depends: debhelper-compat (= 12),
dh-python,
python3-dev,
python3-git,
python3-jinja2,
python3-jsonschema,
python3-markdown,
python3-semantic-version,
python3-yaml,
python3-setuptools
Standards-Version: 4.4.1
Homepage: https://github.com/truenas/apps_validation
Testsuite: autopkgtest-pkg-python

Package: python3-apps-validation
Architecture: any
Depends: python3-semantic-version,
python3-jsonschema,
python3-git,
python3-jinja2,
python3-markdown,
python3-yaml,
${shlibs:Depends},
${misc:Depends},
${python3:Depends}
Description: Validate TrueNAS Catalogs
This package helps validate truenas catalogs.
7 changes: 7 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/make -f
export DH_VERBOSE = 1

export PYBUILD_NAME=apps_validation

%:
dh $@ --with python3 --buildsystem=pybuild
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
1 change: 1 addition & 0 deletions debian/source/options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extend-diff-ignore = "^[^/]*[.]egg-info/"
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ jinja2
jsonschema==4.10.3
markdown
pyyaml
ruamel.yaml
semantic_version
Loading