如何将构建工件转移到当前的工作目录中
我正在尝试找到一种方法,将所有文件从我的伪影文件夹复制到$(System.DefaultWorkingDirectory)
。
现在,我只能使用日志中的绝对路径将其移动,但您必须同意它不是最清洁的方法。
- task: CopyFiles@2
inputs:
SourceFolder: '/home/vsts/work/1/BuildPipeline/drop/'
Contents: '**'
TargetFolder: '$(System.DefaultWorkingDirectory)'
我尝试使用$(System.ArtifactSdirectory)
变量,但是当我使用它时,我最终会使用/home/vsts/work/work/1/a 。
您能推荐一种更好的方法吗?
I'm trying to find a way how to copy all the files from my artifact folder to $(System.DefaultWorkingDirectory)
.
right now i was only able to move it using absolute path from the logs but you must agree its not the cleanest way to do it.
- task: CopyFiles@2
inputs:
SourceFolder: '/home/vsts/work/1/BuildPipeline/drop/'
Contents: '**'
TargetFolder: '$(System.DefaultWorkingDirectory)'
I tried to use $(System.ArtifactsDirectory)
variable but when I use it I end up on /home/vsts/work/1/a
.
can you recommend a better way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
Agent.buildDirectory
指向:/home/vsts/work/1
。所以:
You can use the
Agent.BuildDirectory
which point to:/home/vsts/work/1
.So:
您可以使用
PowerShell
任务递归复制文件:You can use a
powershell
task to copy recursively the files: