The following examples show a few ways in which a UploadArtifact step can be configured. For more information on UploadArtifact Pipeline steps, see UploadArtifact.
Uploading an Artifact to Another Repository using a FileSpec Resource
The most basic form of UploadArtifact. Uses all default values. This step will download the file matching the FileSpec and upload it to the location in targetPath. The optional output FileSpec resource will be updated with the targetPath and the default properties added to the uploaded artifact.
UploadArtifact
pipelines:
- name: uploadArtifactPipeline
steps:
- name: uploadArtifactStep
type: UploadArtifact
configuration:
targetPath: my-repository/myDirectory/myFile.txt
integrations:
- name: myArtifactoryIntegration
inputResources:
- name: myInputFileSpec
outputResources:
- name: myOutputFileSpec
Uploading an Artifact from a RemoteFile Resource
In this example, the input is a RemoteFile resource. Otherwise, this is very similar to the previous example with an input that downloads a file that is then uploaded and an optional FileSpec output updated for the uploaded file.
UploadArtifact
pipelines:
- name: uploadArtifactPipeline
steps:
- name: uploadArtifactStep
type: UploadArtifact
configuration:
targetPath: my-repository/myDirectory/myFile.txt
integrations:
- name: myArtifactoryIntegration
inputResources:
- name: myInputRemoteFile
outputResources:
- name: myOutputFileSpec
Publish Build Info and Trigger Xray Scan
In this example, build info is published as part of the UploadArtifact step and an Xray scan is triggered.
UploadArtifact
pipelines:
- name: uploadArtifactPipeline
steps:
- name: uploadArtifactStep
type: UploadArtifact
configuration:
targetPath: my-repository/myDirectory/myFile.txt
autoPublishBuildInfo: true
forceXrayScan: true
integrations:
- name: myArtifactoryIntegration
inputResources:
- name: myFileSpec
outputResources:
- name: myBuildInfo