-
Notifications
You must be signed in to change notification settings - Fork 2
Repo
This toolkit can publish built elements to a repository and manage that repository.
-
Push element (
pushingenesis_devtools/cmd/cli.pyfunctionpush_cmd)Push artifacts from a built element directory to the configured repository.
# Push the element from the default build output directory (./output) genesis push . # Push from a specific element directory genesis push -e ./output . # Force re-push if such element version already exists genesis push -f . # Use a non-default project config file or target genesis push -c genesis/custom.yaml -t my-target .
Options:
-
-c/--genesis-cfg-file– project config file name (default:genesis/genesis.yaml). -
-t/--target– repository target/id from your project configuration. -
-e/--element-dir– path to element artifacts directory (default:output). -
-f/--force– remove existing element version before pushing again. -
project_dir– path to project root (default: current directory).
-
-
Initialize repository (
repo initingenesis_devtools/cmd/cli.pyfunctionrepo_init_cmd)Creates a new repository structure at the configured destination.
# Initialize repository for the default target genesis repo init . # Recreate repository if it already exists genesis repo init -f . # Use a specific config and target genesis repo init -c genesis/custom.yaml -t my-target .
Options:
-
-c/--genesis-cfg-file,-t/--target,-f/--force,project_dir– see above.
-
-
Delete repository (
repo deleteingenesis_devtools/cmd/cli.pyfunctionrepo_delete_cmd)genesis repo delete . genesis repo delete -c genesis/custom.yaml -t my-target .
-
List repository contents (
repo listingenesis_devtools/cmd/cli.pyfunctionrepo_list_cmd)# List all elements with latest version and versions count genesis repo list . # List versions for a specific element genesis repo list -e genesis-core . # With explicit config/target genesis repo list -c genesis/custom.yaml -t my-target .
Options:
-
-c/--genesis-cfg-file,-t/--target– select repo configuration. -
-e/--element– show versions of a single element. -
project_dir– project root (default: current directory).
-
The repository is accessed via a driver abstraction defined by AbstractRepoDriver in genesis_devtools/repo/base.py.
-
Interface (
AbstractRepoDriver)-
init_repo()– initialize a repository. -
delete_repo()– delete a repository. -
push(element)– publish an element (artifacts + inventory) to the repo. -
pull(element, dst_path)– fetch an element into a local directory. -
remove(element)– remove a specific element version from the repo. -
list() -> dict[str, list[str]]– map of element name to available versions.
-
-
Metadata and errors
-
RepoMetaV1– simple metadata stored asgenesis-repo-meta.jsonat repo root. - Errors:
RepoAlreadyExistsError,RepoNotFoundError,ElementAlreadyExistsError.
-
Repository driver selection is resolved by the CLI using the project configuration and optional --target. See your project configuration for how targets and drivers are defined.
-
Filesystem driver (
FSRepoDriveringenesis_devtools/repo/fs.py)- Layout under repo root:
genesis-elements/<element>/<version>/withinventory.json. -
push()copies files from the element inventory by categories reported byElementInventory.categories(). -
pull()copies back the version directory and writesinventory.jsoninto the destination. -
list()scansgenesis-elements/and returns versions per element. - Notes: uses standard file operations; ensure the repo path is writable. Deletion removes version directories and repo metadata/files when applicable.
- Layout under repo root:
-
Nginx WebDAV driver (
NginxRepoDriveringenesis_devtools/repo/nginx.py)- Stores elements on an Nginx HTTP server with WebDAV enabled.
- Upload via HTTP PUT; download via GET; delete via DELETE.
- Basic authentication supported via requests session auth.
- Repo root contains
genesis-repo-meta.jsonandgenesis-elements/(driver writes a.keeperto create dirs). -
list()parses Nginx autoindex HTML to enumerate directories. - Requirements: Nginx with WebDAV and directory autoindex enabled; correct permissions for PUT/DELETE on the repo paths.
If you use a remote driver (e.g., Nginx), ensure network connectivity and credentials are configured in your project for the chosen --target.