DrewB
DrewB

Reputation: 51

In a VSTS Git build, can Get Sources get one folder instead of the whole repo?

I have multiple builds happening from my repo. Sometimes there's overlap of files needed but many of the builds only require certain folders of the repo for success. However the Get Sources step downloads the whole repo to the agent each time which usually takes ~20 minutes, though sometimes (rarely) it just takes about 5 minutes.

Is there a way for the Get Sources step to only get select folders instead of the whole repo so the build could complete faster?

Choosing a shallow fetch to get the last commit speeds up the process somewhat, fetching about 1/4 of the files fetched without that option. But it's still a long process.

I've seen other solutions mentioned on here, namely using mapping, but that appears to only be available when using TFVC, not VSTS Git. Any other solutions then from a VSTS Git source?

Upvotes: 1

Views: 736

Answers (1)

Marina Liu
Marina Liu

Reputation: 38096

For VSTS git repo, there is no way to specify part of files to be downloaded during Get source step for now.

If the build is queued on private agent, the workaround is set Clean option as false in Get sources step.

enter image description here

After setting Clean option as false, it will download the changed files (instead of all the files) in Get sources step.

Upvotes: 1

Related Questions