I would like to ask how to get path to project (repository) in pipeline (yaml syntax) Azure Devops?
Asked
Active
Viewed 2,776 times
0

Krzysztof Madej
- 32,704
- 10
- 78
- 107

expressiontree
- 71
- 1
- 7
-
`$(Build.SourcesDirectory)`. For a other predefined variable, see this link : https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables – vernou Oct 05 '20 at 16:11
-
How's your issue going? Is Krzysztof Madej's reply helpful? – Cece Dong - MSFT Nov 02 '20 at 09:27
1 Answers
1
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
.

Krzysztof Madej
- 32,704
- 10
- 78
- 107