curate-artifact

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

This Pipelines Task takes a single artifact path from a remote repository, copies it to a local repository and associates it with a build.

Once you have a build name and number there are many additional operations you can perform in your pipeline:

  • Promotion

  • Release Bundle creation

  • Xray scanning

Note

This task does not support Docker repositories.

Prerequisites

This task requires an Artifactory integration or JFrog Platform Access Token integration.

Usage

Basic:

- task: jfrog/curate-artifact@v0.1.0
  id: curate-artifact-example
  input:
    artifactPath: "7/updates/x86_64/Packages/at-3.1.13-25.el7_9.x86_64.rpm"
    remoteRepositoryName: "rpm-remote"
    localRepositoryName: "rpm-dev-local"

The above command will use the first Artifactory integration available to the step. You can pick a specific integration using the artifactoryIntegration input:

- task: jfrog/curate-artifact@v0.1.0
  id: curate-artifact-example
  input:
    artifactPath: "7/updates/x86_64/Packages/at-3.1.13-25.el7_9.x86_64.rpm"
    remoteRepositoryName: "rpm-remote"
    localRepositoryName: "rpm-dev-local"
    artifactoryIntegration: "my_artifactory"

By default, the task will use JFROG_CLI_BUILD_NAME and JFROG_CLI_BUILD_NUMBER environment variables when publishing the build info. You can configure the build info coordinates using the buildName and buildNumber inputs:

- task: jfrog/curate-artifact@v0.1.0
  id: curate-artifact-example
  input:
    artifactPath: "7/updates/x86_64/Packages/at-3.1.13-25.el7_9.x86_64.rpm"
    remoteRepositoryName: "rpm-remote"
    localRepositoryName: "rpm-dev-local"
    buildName: "my-build"
    buildNumber: "1"

Input Variables

Name

Required

Default

Description

artifactPath

true

Path to the artifact, not including the repository prefix

remoteRepositoryName

true

The name of the virtual/remote repo where you want to cache and copy from

localRepositoryName

true

The name of the local repo that you want to copy the artifact into

artifactoryIntegration

false

Any Artifactory integration or JFrog Platform Access Token integration available

The name of the integration to use

buildName

false

$JFROG_CLI_BUILD_NAME

The name for the published build

buildNumber

false

$JFROG_CLI_BUILD_NUMBER

The unique number to use for the published build

Output Variables

Name

Description

buildName

The name of the published build

buildNumber

The number of the published build

You can use the task's outputs to update a Pipelines Build Info resource:

- task: jfrog/curate-artifact@v0.1.0
  id: curate-artifact-example
  input:
    artifactPath: "7/updates/x86_64/Packages/at-3.1.13-25.el7_9.x86_64.rpm"
    remoteRepositoryName: "rpm-remote"localRepositoryName: "rpm-dev-local"

- echo$OUT_curate_artifact_example_buildName
- echo$OUT_curate_artifact_example_buildNumber
- write_output myBuildInfoResourceName "buildName=${$OUT_curate_artifact_example_buildName}""buildNumber=${$OUT_curate_artifact_example_buildNumber}"

Exported Environment Variables

None

How does it work?

This Pipelines Task uses the coordinates provided by the inputs to send requests to Artifactory to perform the following:

  • Caches the artifact in the remote repository using a HEAD request

  • Copies the artifact from the remote to a local repository through the Copy Item REST API

  • Attach the build info properties to the artifact using the Set Item Properties REST API

  • Publishes a build containing a reference to the artifact using the Build Upload REST API

  • Provides the build name and number as the output of the task

License

This project is licensed under Apache 2.0 license.