Expose managed output pruning
This commit is contained in:
44
docs/cli.md
44
docs/cli.md
@@ -22,6 +22,7 @@ distributor help
|
||||
distributor version [--format text|json]
|
||||
distributor run [--config <path>] [--dry-run] [--force] [--format text|json]
|
||||
distributor reconcile-state --config <path> --pipeline <id> --destination <id> [--all-owners] [--dry-run] [--format text|json]
|
||||
distributor prune --config <path> --pipeline <id> --destination <id> (--dry-run|--apply) [--format text|json]
|
||||
distributor serve [--config <path>]
|
||||
distributor validate [--format text|json] <path>
|
||||
distributor validate --config <path> --pipeline <id> [--bundle <path>] [--format text|json]
|
||||
@@ -35,6 +36,7 @@ distributor manifest create --id <bundle-id> [options] <bundle-path>
|
||||
- `version` prints the application name and version.
|
||||
- `run` executes configured pipelines against their destinations.
|
||||
- `reconcile-state` repairs destination state records for missing managed outputs.
|
||||
- `prune` deletes managed outputs selected by the destination retention policy when `--apply` is supplied.
|
||||
- `serve` starts the authenticated HTTP upload API defined by the configuration file.
|
||||
- `validate` checks a local bundle path or a configured source bundle.
|
||||
- `inspect` reports manifest and file metadata for a local bundle path or a configured source bundle.
|
||||
@@ -48,7 +50,7 @@ distributor manifest create --id <bundle-id> [options] <bundle-path>
|
||||
|
||||
### Common Output Format
|
||||
|
||||
`--format text|json` is supported by `version`, `run`, `reconcile-state`, `validate`, `inspect`, and `manifest create`.
|
||||
`--format text|json` is supported by `version`, `run`, `reconcile-state`, `prune`, `validate`, `inspect`, and `manifest create`.
|
||||
|
||||
- `text` is the default human-readable output.
|
||||
- `json` emits one JSON document for successful command execution.
|
||||
@@ -90,6 +92,21 @@ distributor reconcile-state --config <path> --pipeline <id> --destination <id> [
|
||||
|
||||
Without `--dry-run`, `reconcile-state` applies state repair by removing records for managed outputs that no longer exist in storage. It reports unmanaged entries but does not delete destination files, adopt unmanaged files, or validate output digests. The command accepts no positional arguments.
|
||||
|
||||
### `prune`
|
||||
|
||||
```sh
|
||||
distributor prune --config <path> --pipeline <id> --destination <id> (--dry-run|--apply) [--format text|json]
|
||||
```
|
||||
|
||||
- `--config <path>` loads the pipeline configuration and is required.
|
||||
- `--pipeline <id>` selects the pipeline used to identify the destination root and owner scope.
|
||||
- `--destination <id>` selects the destination root and owner scope.
|
||||
- `--dry-run` reports planned managed-output deletes without deleting outputs or rewriting `.distributor.json`.
|
||||
- `--apply` deletes planned managed outputs and rewrites `.distributor.json` after confirmed deletes.
|
||||
- `--format text|json` selects human-readable or machine-readable output.
|
||||
|
||||
Exactly one of `--dry-run` or `--apply` is required. The command uses only the selected destination's configured `retention.prune` policy; it does not accept one-off retention overrides. Apply mode deletes only planned managed output paths, preserves unmanaged files, and preserves `.distributor.json` even when no managed outputs remain.
|
||||
|
||||
### `serve`
|
||||
|
||||
```sh
|
||||
@@ -214,6 +231,30 @@ go run ./cmd/distributor reconcile-state \
|
||||
|
||||
Use `--all-owners` only for shared-root destination state when all owners inside the selected root should be repaired.
|
||||
|
||||
### Prune Managed Outputs
|
||||
|
||||
Preview managed outputs selected by the configured retention policy:
|
||||
|
||||
```sh
|
||||
go run ./cmd/distributor prune \
|
||||
--config examples/local-publish.yml \
|
||||
--pipeline example-source-bundle \
|
||||
--destination local-archive \
|
||||
--dry-run
|
||||
```
|
||||
|
||||
Apply after reviewing the report:
|
||||
|
||||
```sh
|
||||
go run ./cmd/distributor prune \
|
||||
--config examples/local-publish.yml \
|
||||
--pipeline example-source-bundle \
|
||||
--destination local-archive \
|
||||
--apply
|
||||
```
|
||||
|
||||
Use `--format json` when automation needs structured prune results.
|
||||
|
||||
### Run HTML And Fan-Out Examples
|
||||
|
||||
```sh
|
||||
@@ -258,6 +299,7 @@ Text output is optimized for direct operator use. JSON output is optimized for a
|
||||
- Use `inspect --format json` when automation needs manifest metadata, normalized file details, or checksum information.
|
||||
- Use `run --dry-run` before publishing to review destination actions.
|
||||
- Use `reconcile-state --dry-run` to inspect missing managed output records before repairing destination state.
|
||||
- Use `prune --dry-run` before `prune --apply` to review configured retention deletes.
|
||||
- Use [Configuration](config.md) for schema and default details.
|
||||
- Use [Troubleshooting](troubleshooting.md) for common errors and corrective action.
|
||||
- Use [Operations](operations.md) for HTTP upload operation, state files, and recovery workflows.
|
||||
|
||||
Reference in New Issue
Block a user