Edit

Share via


JenkinsDownloadArtifacts@2 - Jenkins download artifacts v2 task

Download artifacts produced by a Jenkins job.

Note

This version of the task uses Azure RBAC to connect to Azure storage. For more information, see Configure Azure RBAC to access Azure storage.

Syntax

# Jenkins download artifacts v2
# Download artifacts produced by a Jenkins job.
- task: JenkinsDownloadArtifacts@2
  inputs:
    jenkinsServerConnection: # string. Alias: serverEndpoint. Required. Jenkins service connection. 
    jobName: # string. Required. Job name. 
    #jenkinsJobType: # string. Optional. Use when jobName = invalidjobName. Jenkins job type. 
    saveTo: 'jenkinsArtifacts' # string. Required. Save to. Default: jenkinsArtifacts.
  # Advanced
    jenkinsBuild: 'LastSuccessfulBuild' # 'LastSuccessfulBuild' | 'BuildNumber'. Required. Download artifacts produced by. Default: LastSuccessfulBuild.
    #jenkinsBuildNumber: '1' # string. Required when jenkinsBuild == BuildNumber. Jenkins build number. Default: 1.
    #itemPattern: '**' # string. Item Pattern. Default: **.
    #downloadCommitsAndWorkItems: false # boolean. Download Commits and WorkItems. Default: false.
    #startJenkinsBuildNumber: # string. Optional. Use when downloadCommitsAndWorkItems == true && jenkinsBuild == BuildNumber. Download commits and work items from. 
    #artifactDetailsFileNameSuffix: # string. Optional. Use when downloadCommitsAndWorkItems == invalid. Commit and WorkItem FileName. 
  # Propagated Artifacts
    #propagatedArtifacts: false # boolean. Artifacts are propagated to Azure. Default: false.
    #artifactProvider: 'azureStorage' # 'azureStorage'. Required when propagatedArtifacts == notValid. Artifact Provider. Default: azureStorage.
    #ConnectedServiceNameARM: # string. Required when propagatedArtifacts == true. Azure Subscription. 
    #storageAccountName: # string. Required when propagatedArtifacts == true. Storage Account Name. 
    #containerName: # string. Required when propagatedArtifacts == true. Container Name. 
    #commonVirtualPath: # string. Optional. Use when propagatedArtifacts == true. Common Virtual Path.

Inputs

jenkinsServerConnection - Jenkins service connection
Input alias: serverEndpoint. string. Required.

Select the service connection for your Jenkins instance. To create one, click the Manage link and create a new Jenkins service connection.


jobName - Job name
string. Required.

The name of the Jenkins job to download artifacts from. This must exactly match the job name on the Jenkins server.


jenkinsJobType - Jenkins job type
string. Optional. Use when jobName = invalidjobName.

Jenkins job type, detected automatically.


saveTo - Save to
string. Required. Default value: jenkinsArtifacts.

Jenkins artifacts will be downloaded and saved to this directory. This directory will be created if it does not exist.


jenkinsBuild - Download artifacts produced by
string. Required. Allowed values: LastSuccessfulBuild (Last Successful Build), BuildNumber (Build Number). Default value: LastSuccessfulBuild.

Download artifacts produced by the last successful build, or from a specific build instance.


jenkinsBuildNumber - Jenkins build number
string. Required when jenkinsBuild == BuildNumber. Default value: 1.

Download artifacts produced by this build.


itemPattern - Item Pattern
string. Default value: **.

Specify files to be downloaded as multi line minimatch pattern. More Information

The default pattern (**) will download all files across all artifacts produced by the Jenkins job. To download all files within artifact drop use drop/**.

.


downloadCommitsAndWorkItems - Download Commits and WorkItems
boolean. Default value: false.

Enables downloading the commits and work item details associated with the Jenkins Job.


startJenkinsBuildNumber - Download commits and work items from
string. Optional. Use when downloadCommitsAndWorkItems == true && jenkinsBuild == BuildNumber.

Optional start build number for downloading commits and work items. If provided, all commits and work items between start build number and build number given as input to download artifacts will be downloaded.


artifactDetailsFileNameSuffix - Commit and WorkItem FileName
string. Optional. Use when downloadCommitsAndWorkItems == invalid.

Optional file name suffix for commits and work item attachments. Attachments will be created with commits_{suffix}.json and workitem_{suffix}.json. If this input is not provided, attachments will be created with the name commits.json and workitems.json.


propagatedArtifacts - Artifacts are propagated to Azure
boolean. Default value: false.

Check this if Jenkins artifacts were propagated to Azure. To upload Jenkins artifacts to azure, refer to this Jenkins plugin.


artifactProvider - Artifact Provider
string. Required when propagatedArtifacts == notValid. Allowed values: azureStorage (Azure Storage). Default value: azureStorage.

Choose the external storage provider used in Jenkins job to upload the artifacts.


ConnectedServiceNameARM - Azure Subscription
string. Required when propagatedArtifacts == true.

Choose the Azure Resource Manager subscription for the artifacts.

Note

This version of the task uses Azure RBAC to connect to Azure storage. For more information, see Configure Azure RBAC to access Azure storage.


storageAccountName - Storage Account Name
string. Required when propagatedArtifacts == true.

Azure Classic and Resource Manager stoarge accounts are listed. Select the Storage account name in which the artifacts are propagated.


containerName - Container Name
string. Required when propagatedArtifacts == true.

Name of the container in the storage account to which artifacts are uploaded.


commonVirtualPath - Common Virtual Path
string. Optional. Use when propagatedArtifacts == true.

Path to the artifacts inside the Azure storage container.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

Configure Azure RBAC to access Azure storage

This version of the task uses an Azure Resource Manager service connection configured using workload identity federation and Azure RBAC to connect to Azure storage instead of storage account keys or shared access signatures (SAS). To connect to Azure storage from this task, you must assign the Storage Blob Data Contributor role on the storage account to the identity of the service connection configured for ConnectedServiceNameARM. For more information, see Assign an Azure role for access to blob data and Steps to assign a role.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 2.144.0 or greater
Task category Utility