azure - 天蓝色任务:复制文件@2如果没有匹配的文件抛出错误
问题描述
如果没有文件匹配,我喜欢让任务失败。从阅读文件
我可以看到它的行为完全相反。
这是我的下载和复制任务,当它的 0 个文件抛出错误并使管道失败时如何
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'Artifacts'
itemPattern: |
**/*.a
**/*s.plist*
downloadPath: '$(System.ArtifactsDirectory)'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.ArtifactsDirectory)'
Contents: |
**/*.a
**/*s.plist*
TargetFolder: '$(Agent.HomeDirectory)/../${{parameters.FolderCompile}}'
解决方案
你能做的只有:
- 如果有 eny 文件,则将 powershell/bash 脚本写入 schek,如果没有,
exit 1
则从脚本中生成使任务失败的内容 CopyFiles
以类似的方式分析您的任务日志
推荐阅读
- c++ - OpenCV 3 中的神经网络权重
- linux - Linux Debian 9 守护进程标准输入 (bash)
- php - 将数据库中的项目显示为复选框选项
- reactjs - 如何检测 FlatList 何时呈现所有项目并实际滚动到底部?
- php - 我可以像这样从我的数据库中替换 PHP 中的数据吗?
- python - 如果列 id 值更大,则 Python Pandas
- javascript - 是否可以使用 javascript 和 html 链接按 F1-F12 按钮?
- angular - FileReader 属性的 jasmine spyon readAsBinaryString 方法
- firebase - 当我订阅一个不存在的主题时,Firebase 会创建一个主题吗?
- c - C中的冒泡排序