Azure 管道:DownloadBuildArtifacts@0 任务 itemPattern,无法下载具有不同文件后缀和名称模式的 2 个文件

Azure pipeline : DownloadBuildArtifacts@0 task itemPattern , can't download 2 files with different file suffixs and name paternes

我正在使用 DownloadBuildArtifacts@0,我喜欢下载所有 *.ipa 文件以及 manifest.plist 文件 。 写作时:itemPattern: '**/*.ipa 它给我下载 ipa 文件 但是当我这样做时:

- job: copy_back_files_to_self_hosted_connect
  dependsOn: mac_agent 
  timeoutInMinutes: 10
  pool: Default
  steps:
    - task: DownloadBuildArtifacts@0
      inputs:
        buildType: 'current'
        downloadType: 'single'
        artifactName: 'Artifacts'
        itemPattern: '**/*.ipa|manifest.plist'
        downloadPath: '$(System.ArtifactsDirectory)'
    - task: CopyFiles@2
      inputs:
        SourceFolder: '$(System.ArtifactsDirectory)'
        Contents: '**/*.ipa|manifest.plist'
        TargetFolder: '$(Agent.HomeDirectory)/../${{parameters.FolderCompile}}'

它下载了我 none 的文件,不是 ipa,也不是 manifest.plist
始终下载两者的正确模式是什么?

你可以这样做:

- task: DownloadBuildArtifacts@0
  inputs:
    buildType: 'current'
    downloadType: 'single'
    artifactName: 'Artifacts'
    itemPattern: |
      **/*.ipa
      manifest.plist
    downloadPath: '$(System.ArtifactsDirectory)'

来自您之前的票....

您需要按以下格式定义您的任务:

- task: DownloadBuildArtifacts@0
  displayName: 'Download Build Artifacts'
  inputs:
    buildType: 'current'
    downloadType: 'single'
    artifactName: Artifacts
    itemPattern: |
     **/*.ipa
     **/manifest.plist

- task: CopyFiles@2
  displayName: 'Copy Files'
  inputs:
    SourceFolder: '$(System.ArtifactsDirectory)'
    Contents: |
     **/*.ipa
     **/manifest.plist
    TargetFolder: '$(Agent.HomeDirectory)/../${{parameters.FolderCompile}}'

由于.ipamanifest.plist都来自构建工件:Artifacts,它们都在Artifacts下 文件夹。所以,也请不要忘记使用 **/manifest.plist 来检索您需要的文件。