Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 2.45 KB

accessing-artifacts.adoc

File metadata and controls

49 lines (38 loc) · 2.45 KB

Accessing artifacts

ODS Pipeline is able to create and retain artifacts recording information related to a pipeline run. Those artifacts may be test reports, scan results, image digests, deployment records, etc whereas container images are pushed to the cluster’s image registry. They are created during a pipeline run, associated with the commit being built and uploaded to Nexus. This document will describe how you can access the artifacts later on. A typical use case for this is attaching artifacts to verification reports for your (regulated) software.

Artifact Storage

Artifacts are stored in Nexus repositories of type raw. When a pipeline finishes, it uploads any artifacts created during the run to the Nexus repository identified by the parameter artifact-target, which can be set from a trigger:

name: finish.artifact-target
value: my-nexus-repo

Downloading Artifacts

While artifacts are plain Nexus assets and can therefore be downloaded via standard means (e.g. via curl or in the Nexus web interface), this would be very time consuming for many artifacts. To make it quick and easy to download all artifacts related to a certain revision in one go, ODS Pipelines ships with the artifact-download binary. This binary can be built from this repository via make build-artifact-download or simply downloaded pre-built from the GitHub release page.

Usage:

artifact-download \
  --namespace my-project-cd \
  --artifact-source nexus-repo

The binary will then fetch artifacts for the checked out revision of the Git repository in the working directoy, as well as for any subrepositories that might be configured, and download them into artifacts-out. Example:

artifacts-out/
├─ my-repo/
│  ├─ xunit-reports/
│  │  ├─ report.xml
│  │  ├─ index.html
│  ├─ sonarqube-analysis/
│  │  ├─ analysis-report.md
│  │  ├─ issues-report.csv
│  ├─ pipeline-runs/
│  │  ├─ run-123.json
├─ my-subrepo/
│  ├─ xunit-reports/
│  │  ├─ report.xml
│  │  ├─ index.html
│  ├─ sonarqube-analysis/
│  │  ├─ analysis-report.md
│  │  ├─ issues-report.csv
Important
Using artifact-download requires to be logged into your cluster (oc login …​) in the terminal. The binary fetches all required credentials (e.g. to access Nexus) from the specified namespace.

See artifact-download --help for all options, e.g. how to specify another output directory.