expressiontree
expressiontree

Reputation: 91

How to get path to project in pipleline Azure Devops?

I would like to ask how to get path to project (repository) in pipeline (yaml syntax) Azure Devops?

Upvotes: 1

Views: 4872

Answers (2)

I.sh.
I.sh.

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

Krzysztof Madej
Krzysztof Madej

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) is C:\agent\_work\1 and your repositories are named tools and code, your code is checked out to C:\agent\_work\1\s\tools and C:\agent\_work\1\s\code.

Upvotes: 2

Related Questions