Skip to content

Using artifacts

Artifacts allow you to persist data after a workflow has completed.

An artifact is a file or collection of files produced and uploaded as final deliverables. For example, artifacts might include binary or package files, test results, screenshots, or log files. You can download artifacts using various command line tools (curl) or use in a separate pipeline.

Overview

Razorops provides two steps that you can use to upload and download artifacts. For more information, see the artifacts/push and artifacts/pull steps.

Artifacts are uploaded during a workflow run, and you can view an artifact's name and size in the UI. Mostly you will be using artifacts/push step to publish deliverables whereas artifacts/pull is used rarely in pipeline.

Example

A simple example of using the artifacts definition would be the following:

tasks:
  pdf:
    steps:
    - run: make test
    ...
    - artifacts/push:
        name: logs-screenshot
        paths:
        - logs/test.log
        - screenshots
      always: true  ## publish even if the task fails

Publish artifacts

Each workflow gets it's own artifact store. You can define artifacts/push step with following properties:

  • name - an unique identifier in the project. You can refer an artifact by name easily during download.
  • paths - an array of files and directories relative to the current workspace. Globbing in paths is not supported.

Tip

You can use always: true to execute artifacts/push step even if a task fails.

Usage limits

These uploaded artifacts will be kept in Razorops for 1 week.

Download artifacts

You can use any command line tool (curl or wget) to download published artifacts by name, pipeline id and workflow number. You use use latest to infer the latest workflow run that produced the artifact.

# download latest artifact with name={name}
curl -sLO https://api.razorops.com/workflows/{pipeline}/artifacts/latest/{name}.tgz

# download latest artifact with name={name} in workflow run=10
curl -sLO https://api.razorops.com/workflows/{pipeline}/artifacts/10/{name}.tgz