首页 > 解决方案 > azure pipeline TFVC check if a specific Build pipeline artifacts exist for a specific Branch name and specific tag

问题描述


I am using Azure DevOps services and TFVC as my code repository. I have a build that has a task type "Download build artifacts" (Download files that were saved as artifacts of a completed build). What i need to check is if there are saved artifacts of a specific completed build for a specific Branch name and tag? because if there isn't the task will fail and i want to fall to a default artifact.

Thanks

标签: azure-devops

解决方案


只需像这样定义此任务:

steps:
- task: DownloadBuildArtifacts@0
  displayName: 'Download Build Artifacts'
  inputs:
    buildType: specific
    project: '{project name}'
    pipeline: {pipeline name}
    buildVersionToDownload: latestFromBranch
    branchName: '{Branch name, e.g. $/TFVC}'
    tags: {the tag you want to filtered}
    downloadType: specific
    downloadPath: '$(Build.ArtifactStagingDirectory)'

在此任务定义中,最关键的参数是 ,branchname因为您使用的是TFVC 存储库。

在此处输入图像描述


推荐阅读