This extension is used to centralize pipeline-local repositories per software agent and save disk space by sharing repositories between different pipelines of the same software agent.
This means that repositories below
$(Agent.BuildDirectory) (for example
$(Agent.BuildDirectory)/s) can be moved to a centralized location below
$(Agent.WorkFolder). This location is only centralized per software agent, and since only one pipeline can run per software agent, there's never the danger of two builds accessing the same centralized repository at the same time. However, you have to make sure that you never move two different repositories of the same name (say from two different team projects) to the same centralized location. Either give them a different name during checkout, or move them to a different centralized (folder) location with the
This buildstep should be executed after the checkouts of the repositories to centralize.
Possible inputs are:
DefaultRepository: string, The name for the folder used for the default repository of the current build normaly stored at
$(Agent.BuildDirectory)/s in the centralized location. Do not use quotes to define the path. Leave blank or don't provide if you do not want to centralize the default repository. Make sure this name will never be used by another repository on this software agent in the same centralized location. You can use variables , example: MyMainRepo
Repositories: string, The name of the repository folders to move to the centralized location. You can separate multiple repository folders with commas. Do not use quotes to define paths. Leave blank or don't provide if you do not want to centralize any other repositories beside the default repository. Make sure these names will not be used by other repositories on this software agent in the same centralized location. You can use variables , example: MyFirstSideRepo, MySecondSideRepo
CentralizedLocation: string, The path or folder below $(Agent.WorkFolder) in which to move the centralized repositories to. Do not use quotes to define the path. Default is 'Repositories'. You can use variables
UseJunctions: true/false, Should we use junctions instead of symbolic links? Default is false and will use symbolic links.
pwsh: true/false, Should Powershell Core be used if it exists? Default is true and will use powershell core. Otherwise the normal Windows Powershell (5) will be used.
This example will check out the default repository to
$(Agent.BuildDirectory)/s as well as the repository MyFirstSideRepository to
$(Agent.BuildDirectory)/My1stSideRepository and repository MySecondSideRepository to
It will then centralize these repositories to
$(Agent.WorkFolder) will be the
- checkout: self
- checkout: MyFirstSideRepository
- checkout: MySecondSideRepository
- task: tun.CentralizeRepositories.CentralizeRepositories.CentralizeRepositories@1
displayName: 'Centralize repositories'
Repositories: My1stSideRepository, MySecondSideRepository