2任务副本的文件

2任务副本的文件

本文介绍了来自代理A的azure devops管道CopyFiles @ 2任务副本的文件,但DownloadBuildArtifacts @ 0将文件下载到代理B的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对来自托管代理的复制文件有有线行为,然后将它们下载回相同的代理看起来它从代理程序A复制文件,但是同一管道将它们下载回代理程序B与是在另一台机器上执行另一个不相关的构建工作

i have wired behavior with the copy files from hosted agent and then downloading them back to the same agentlooks like it copies the files from agent A but the same pipeline downloading them back to Agent Bwith is in another machine doing another build job that is not related

从ios_docker_142_linux_slave_1上传

Upload from ios_docker_142_linux_slave_1

下载回不同的代理ios_docker_141_linux_slave_3,为什么?

Download back to different agent ios_docker_141_linux_slave_3 , why ?

 - task: CopyFiles@2
    inputs:
      CleanTargetFolder: 'true'
      SourceFolder: '$(Agent.HomeDirectory)/../${{parameters.Folderpath}}'
      Contents: '**'
      TargetFolder: '$(build.artifactstagingdirectory)'

推荐答案

如果您正在使用并行作业,则这是预期的行为.根据您的屏幕截图,有多个作业是自托管的connect,mac_agent,copy_back_files_to_self..

This is an expected behavior if you are using parallel jobs. According to your screenshot, there are multiple jobs self-hosted connect , mac_agent, copy_back_files_to_self..

一个座席一次完成一项工作.如果代理程序正在运行作业,它将处于繁忙状态,而其他作业将寻找要运行的空闲代理程序.并行作业用于一次在多个代理中运行多个作业.

One agent one job at a time. If the agent is running a job, it will in busy status, and other jobs will look for idle agents to run . The parallel jobs is for running multiple jobs in multiple agents at a time.

要实现所需的功能,您需要在YAML文件中指定详细代理.池名称需要添加到 name 字段中,然后可以添加 需求 .您可以尝试以下YAML代码:

To achieve what you want, you need to specify detail agent in your YAML file. The pool name needs to add to the name field, then you could add demands. You may try the following YAML Code:

stages:

- stage: Deploy

  pool:

   name: AgentPoolName(e.g. alm-aws-pool)

   demands:

    - agent.name -equals Agentname (e.g. deploy-05-agent1)

  jobs:

  - job: BuildJob

    steps:

    - script: echo Building!

这篇关于来自代理A的azure devops管道CopyFiles @ 2任务副本的文件,但DownloadBuildArtifacts @ 0将文件下载到代理B的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 11:45