我们正在使用 Microsoft 托管代理来运行应用程序自动化测试场景的构建管道。我们想要实现的是,通过自动化程序下载文件(从无头 Chrome 浏览器),然后导航到下载路径并打开它。
如何找到代理内下载文件的路径?
快速编译与在 Linux 和 Windows 自托管代理上构建的路径相关的预定义变量列表官方文档链接.
您正在寻找的是Agent.BuildDirectory
or Pipeline.Workspace
.
预定义变量列表:
Variable type |
Variable |
Description |
Example |
Agent |
Agent.BuildDirectory |
The local path on the agent where all folders for a given build pipeline are created |
D:\..\agent\_work\1 |
Agent |
Agent.HomeDirectory |
The directory the agent is installed into |
C:\agent |
Agent |
Agent.TempDirectory |
A temporary folder that is cleaned after each pipeline job |
D:\..\agent\_work\_temp |
Agent |
Agent.ToolsDirectory |
The directory used by tasks such as Node Tool Installer and Use Python Version to switch between multiple versions of a tool |
D:\..\agent\_work\_tool |
Agent |
Agent.WorkFolder |
The working directory for agent |
c:\agent_work |
Build |
Build.SourcesDirectory |
The local path on the agent where your source code files are downloaded. |
c:\agent_work\1\s |
Build |
Build.ArtifactStagingDirectory |
The local path on the agent where any artifacts are copied to before being pushed to their destination. A typical way to use this folder is to publish your build artifacts with the Copy files and Publish build artifacts tasks |
c:\agent_work\1\a |
Build |
Build.StagingDirectory |
The local path on the agent where any artifacts are copied to before being pushed to their destination. |
c:\agent_work\1\a |
Build |
Build.BinariesDirectory |
The local path on the agent you can use as an output folder for compiled binaries |
c:\agent_work\1\b |
Build |
Build.Repository.LocalPath |
The local path on the agent where your source code files are downloaded. |
c:\agent_work\1\s |
Build |
Common.TestResultsDirectory |
The local path on the agent where the test results are created. |
c:\agent_work\1\TestResults |
Pipeline |
Pipeline.Workspace |
The Workspace directory for a particular pipeline |
/home/vsts/work/1 |
System |
System.DefaultWorkingDirectory |
The local path on the agent where your source code files are downloaded. |
c:\agent_work\1\s |
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)