Install
Guides

Replication

Copy a repository to or from another server, or keep two servers' repositories alike.

A replication links a local repository to one on another server, run by the worker on a schedule.

DirectionA run
pushcopies files the target lacks or holds another version of; with syncDeletes, deletes the target's files this repository no longer has
pullcopies the target's files this repository lacks or holds another version of, verifying checksums; with syncDeletes, deletes files the target no longer has
federatedpulls, then pushes, so both end up alike

A federated replication also runs on each deploy and delete; the newest write or delete wins. Configure it on both servers, each pointing at the other. With syncProperties, pushes make the properties of each target file match the source, removing the ones the source no longer has, without deploying a file again when only its properties changed; the replication user needs annotate permission on the target. With onChange, a push replication also runs after each change.

The other server, a Relic or an Artifactory, is reached through the JFrog® Artifactory® REST API. For a private address, set RELIC_UPSTREAM_ALLOW_PRIVATE_ADDRESSES=true on the server and the worker. When the other server's certificate comes from a private authority, such as the one relic server setup creates, copy that authority's certificate to this server and set RELIC_UPSTREAM_CA_CERTIFICATE_FILE on the server and the worker. For a service that relic server setup installed:

relic server config set RELIC_UPSTREAM_CA_CERTIFICATE_FILE=/etc/relic/peer-ca.crt

The password is never returned. An update without one keeps it while the target URL keeps its scheme, host and port.

apiVersion: relic.build/v1
kind: Replication
metadata: {name: libs-release}
spec:
  direction: federated
  targetUrl: https://relic-eu.example.com/artifactory/libs-release
  username: replicator
  password: change-me
  schedule: "*/15 * * * *"
  enabled: true

Apply it:

relic apply -f replication.yaml

Run it now:

relic replication run libs-release