Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download Pipeline Artifact V1 #9067

Binary file added Tasks/DownloadPipelineArtifactV1/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 156 additions & 0 deletions Tasks/DownloadPipelineArtifactV1/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
202 changes: 202 additions & 0 deletions Tasks/DownloadPipelineArtifactV1/task.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
{
"id": "61F2A582-95AE-4948-B34D-A1B3C4F6A737",
"name": "DownloadPipelineArtifact",
"friendlyName": "Download Pipeline Artifact",
"description": "Download Pipeline Artifact",
"helpMarkDown": "Download named artifact from a pipeline to a local path.",
"category": "Utility",
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 0,
"Patch": 0
},
"groups": [],
"demands": [],
"preview": true,
"minimumAgentVersion": "2.147",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.147.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

"inputs": [
{
"name": "buildType",
"type": "radio",
"label": "Download artifacts produced by",
"defaultValue": "current",
"required": true,
"options": {
"current": "Current build",
"specific": "Specific build"
},
"helpMarkDown": "Download artifacts produced by the current build, or from a specific build."
},
{
"name": "project",
"type": "pickList",
"label": "Project",
"defaultValue": "",
"required": true,
"visibleRule": "buildType == specific",
"properties": {
"EditableOptions": "True",
"DisableManageLink": "True"
},
"helpMarkDown": "The project from which to download the pipeline artifacts."
},
{
"name": "definition",
"aliases": [
"pipeline"
],
"type": "pickList",
"label": "Build pipeline",
"defaultValue": "",
"required": true,
"visibleRule": "buildType == specific",
"properties": {
"EditableOptions": "True",
"DisableManageLink": "True",
"IsSearchable": "True"
},
"helpMarkDown": "Select the build pipeline name."
},
{
"name": "specificBuildWithTriggering",
"type": "boolean",
"label": "When appropriate, download artifacts from the triggering build.",
"defaultValue": "false",
"required": false,
"visibleRule": "buildType == specific",
"helpMarkDown": "If checked, this build task will try to download artifacts from the triggering build. If there is no triggering build from the specified pipeline, it will download artifacts from the build specified in the options below."
},
{
"name": "buildVersionToDownload",
"type": "pickList",
"label": "Build version to download",
"defaultValue": "latest",
"visibleRule": "buildType == specific",
"required": true,
"options": {
"latest": "Latest",
"latestFromBranch": "Latest from specific branch and specified Build Tags",
"specific": "Specific version"
}
},
{
"name": "branchName",
"type": "string",
"label": "Branch name",
"defaultValue": "refs/heads/master",
"visibleRule": "buildType == specific && buildVersionToDownload == latestFromBranch",
"required": true,
"helpMarkDown": "Specify to filter on branch/ref name, for example: ```refs/heads/develop```."
},
{
"name": "buildId",
"type": "pickList",
"label": "Build",
"defaultValue": "",
"required": true,
"visibleRule": "buildType == specific && buildVersionToDownload == specific",
"properties": {
"EditableOptions": "True",
"DisableManageLink": "True"
},
"helpMarkDown": "The build from which to download the artifacts."
},
{
"name": "tags",
"type": "string",
"label": "Build Tags",
"defaultValue": "",
"visibleRule": "buildType == specific && buildVersionToDownload != specific",
"required": false,
"helpMarkDown": "A comma-delimited list of tags. Only builds with these tags will be returned."
},
{
"name": "artifactName",
"type": "pickList",
"label": "Artifact name",
"defaultValue": "",
"required": true,
"properties": {
"EditableOptions": "True",
"DisableManageLink": "True"
},
"helpMarkDown": "The name of the artifact to download."
},
{
"name": "itemPattern",
"type": "multiLine",
"label": "Matching pattern",
"defaultValue": "**",
"required": false,
"properties": {
"rows": "3",
"resizable": "true"
},
"helpMarkDown": "Specify files to be downloaded as multi line minimatch pattern. [More Information](https://aka.ms/minimatchexamples).</p>"
},
{
"name": "downloadPath",
"type": "string",
"label": "Destination directory",
"defaultValue": "$(System.ArtifactsDirectory)",
"required": true,
"helpMarkDown": "Path on the agent machine where the artifacts will be downloaded."
}
],
"dataSourceBindings": [
{
"endpointId": "tfs:teamfoundation",
"target": "project",
"endpointUrl": "{{endpoint.url}}/_apis/projects?$skip={{skip}}&$top=1000",
"resultSelector": "jsonpath:$.value[?(@.state=='wellFormed')]",
"resultTemplate": "{ \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{name}}}\" }",
"callbackContextTemplate": "{\"skip\": \"{{add skip 1000}}\"}",
"callbackRequiredTemplate": "{{isEqualNumber result.count 1000}}",
"initialContextTemplate": "{\"skip\": \"0\"}"
},
{
"endpointId": "tfs:teamfoundation",
"target": "definition",
"endpointUrl": "{{endpoint.url}}/{{project}}/_apis/build/definitions?api-version=3.0-preview&$top=500&continuationToken={{{continuationToken}}}&name=*{{name}}*&queryOrder=2",
"resultSelector": "jsonpath:$.value[?(@.quality=='definition')]",
"parameters": {
"project": "$(project)",
"name": "$(name)"
},
"resultTemplate": "{ \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{name}}}\" }",
"callbackContextTemplate": "{\"continuationToken\" : \"{{{headers.x-ms-continuationtoken}}}\"}",
"callbackRequiredTemplate": "{{{#headers.x-ms-continuationtoken}}}true{{{/headers.x-ms-continuationtoken}}}",
"initialContextTemplate": "{\"continuationToken\" : \"{{{system.utcNow}}}\"}"
},
{
"endpointId": "tfs:teamfoundation",
"target": "buildId",
"endpointUrl": "{{endpoint.url}}/{{project}}/_apis/build/builds?definitions={{definition}}&resultFilter=succeeded,partiallySucceeded&$top=200",
"resultSelector": "jsonpath:$.value[*]",
"parameters": {
"project": "$(project)",
"definition": "$(definition)"
},
"resultTemplate": "{ \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{buildNumber}}}\" }"
},
{
"endpointId": "tfs:teamfoundation",
"target": "artifactName",
"endpointUrl": "{{endpoint.url}}/{{project}}/_apis/build/builds/{{buildId}}/artifacts",
"resultSelector": "jsonpath:$.value[*]",
"parameters": {
"project": "$(project)",
"buildId": "$(buildId)"
},
"resultTemplate": "{ \"Value\" : \"{{{name}}}\", \"DisplayValue\" : \"{{{name}}}\" }"
}
],
"instanceNameFormat": "Download Pipeline Artifact",
"execution": {
"AgentPlugin": {
"target": "Agent.Plugins.PipelineArtifact.DownloadPipelineArtifactTaskV1, Agent.Plugins"
}
},
"messages": {}
}
Loading