Builds and images
Recording a run
A run is assembled locally, command by command, then published. Runs in
progress live in $RELIC_BUILD_DIR (default: builds/ next to the config
file), so the commands can run in separate CI steps.
Record environment variables as env.<NAME> properties, leaving out names
that look secret:
relic build collect-env app 42 --include 'CI_*'
Record the Git remote (without credentials), branch and revision:
relic build add-git app 42
Upload an artifact and record it in the run. It also gets the build.name,
build.number and build.timestamp properties:
relic artifact upload target/app.jar libs-local/org/app/1.0/app.jar --build app/42
Record local files as dependencies (with --from-relic, files stored in
Relic, as <repository>/<path>):
relic build add-dependencies app 42 vendor/*.jar --type maven --scope compile
Record a container image's manifest and layers, read from Relic. For a multi-platform image (an index), the index and each platform manifest stored in the repository are recorded with their layers:
relic build add-image app 42 docker-local/team/app:1.4.0
Add the published run app/42 to run release/7 as a module:
relic build append release 7 app 42
Publish the run and forget it locally (--dry-run prints it instead). It fails
when no run of that name and number is recorded locally:
relic build publish app 42
Forget a run without publishing it:
relic build clean app 42
Published runs
List the published builds, with the start of each one's latest run:
relic build list
List a build's runs, newest first:
relic build list app
Show a run: its agent, sources, and each module's artifacts and dependencies.
-o json or -o yaml prints every field, checksums included:
relic build get app 42
Builds of a project take --project.
Scanning
Scan a run and wait for the result. The command exits with 1 if a violated
rule fails builds, unless --fail=false:
relic build scan app 42
A dependency whose ID names a package (name:version, or
group:artifact:version for Maven) is scanned as that package; other
dependencies and the artifacts count by their content. The policies of the
watches covering the build then apply. When no worker with Relic Scan has reported
in the last 20 minutes (scanning is off, or those workers stopped), the command
fails at once with unavailable.
Promoting and retention
Promote a run to a repository, set its status and add a property:
relic build promote app 42 libs-release --status released --props release=1.0
--copy copies instead of moving, --dependencies includes the dependencies
and --dry-run previews. A promotion with an error exits with 1.
Keep the 20 newest runs of app, and never discard run 1.0.0:
relic build discard app --max-runs 20 --keep 1.0.0
Discard runs older than 90 days, with their artifacts:
relic build discard app --max-days 90 --delete-artifacts
Container images
Copy an image to another repository:
relic image promote docker-dev/team/app:1.4.0 docker-prod --copy
Move an image under a new name and tag (--all-tags moves every tag):
relic image promote docker-dev/team/app:1.4.0 docker-prod/release/app:stable
Moving needs delete permission on the source, copying needs read; both need write permission on the target.