Reputation: 91
I would like to ask how to get path to project (repository) in pipeline (yaml syntax) Azure Devops?
Upvotes: 1
Views: 4872
Reputation: 1993
The $(System.DefaultWorkingDirectory)
System-Variable or $(Build.SourcesDirectory)
Build-Variable returns the local path on the agent where your source code files are downloaded. (repo root dir)
For example: c:\agent_work\1\s
Upvotes: 0
Reputation: 40613
You should use $(Agent.BuildDirectory)/s
or $(Build.SourcesDirectory)
for single repo, but if you use muli repo please check this link
If you have multiple checkout steps in your job, your source code is checked out into directories named after the repositories as a subfolder of s in (Agent.BuildDirectory). If
(Agent.BuildDirectory)
isC:\agent\_work\1
and your repositories are namedtools
andcode
, your code is checked out toC:\agent\_work\1\s\tools
andC:\agent\_work\1\s\code
.
Upvotes: 2