Replication, Distribution and Automation (REST API / CLI)
Replication, Distribution and Automation (REST API / CLI)
This domain tests moving artifacts between Artifactory instances, distributing release bundles to Edge nodes, and automating operations with REST and CLI.
Core rules
- Push replication copies artifacts from a local repository to a repository on another Artifactory instance. Pull replication makes a remote repository on the target periodically fetch from an upstream local repository. Both are configured with a URL, credentials, cron schedule, path prefix, and include/exclude patterns.
- Replication is asynchronous and repository-scoped. It does not replace HA or backup. The initial run can be large; schedule it outside peak hours and monitor replication status.
- Distribution uses release bundles: immutable sets of artifacts and metadata signed and distributed to Edge nodes. A release bundle is created from build info or artifacts, then distributed to a distribution repository on Edge.
- The REST API exposes repositories, artifacts, permissions, builds, replication, and search. Authenticate with a bearer token or basic credentials; prefer tokens for automation. JFrog CLI wraps common REST calls (
jf rt upload,jf rt search,jf rt curl). - AQL is the advanced search language for metadata, properties, and build relationships. Use it for cleanup and promotion candidates, and test queries before destructive automation.
Worked example
A nightly job must copy only release jars to a disaster-recovery site. Configure push replication on libs-release-local with a cron schedule, path prefix com/acme/, and exclude **/*-SNAPSHOT*. The target repository is the DR Artifactory's local repository endpoint. After the first run, verify a sample artifact's checksum on both sides. For a one-off audit, run an AQL query for repo = "libs-release-local" and @stage = "release", then use jf rt curl to delete stale candidates after review.
Traps
Using replication as a synchronous failover mechanism. Replicating a virtual repository instead of the local repository that holds content. Forgetting credentials or path filters, causing full-repository copies. Running destructive AQL or REST deletes without a dry-run list. Assuming Edge distribution is the same as repository replication; release bundles add signing and immutable versioning.