12
votes

I'm using TFS 2015 Update 2 Release Management (i.e, the "Release" tab), and I've got my build putting the desired output in a file share drop location. It looks something like:

/Drop
--> /App 1
--> /App 2
--> /App 3

My Release Definition has a Powershell task to deploy each application. This works great, and because each of the above apps (App 1, App 2, App 3) are all defined as their own artifacts, I get nice path selection when I bring up the Linked Artifacts dialog when finding the powershell script to execute.

The problem is when the VSOAgent is doing the deployment on a given deployment server, it downloads ALL linked artifacts for the entire release definition - regardless of if they're used. So if I have a single Powershell task referencing App 1, I get App 2 and App 3 downloaded as well.

In my case, my build results in dozens of artifacts, only perhaps 20% of which are deployed to any given environment. So I'm download a TON of stuff that I don't need. Indeed, this means something that should take (and DID take in the old Release Management) perhaps 5 minutes now takes 20 minutes just to download the artifacts.

Is there a way to prevent this?

4
What tasks are in your release definition? - chief7
Can you you use the Windows Machine File Copy task to copy just what you need to a target node and then use WinRM to carry out the deployment locally? Something like this. - Graham Smith
Why not store the artifacts to "Server" so that they're attached to the Build, instead of storing on a file share? - BrettJ
There is now an extension for VSTS and on-prem TFS that solves the issue: github.com/chamindac/vsts.release.task.download-artifacts - RMD
Microsoft never implemented this feature in VSTS/TFS 2018 Update 2, but closed the ticket as completed. If you want this feature, please vote on this cloned ticket on UserVoice. - Kevin Jones

4 Answers

9
votes

Release Management downloads all the artifacts published by the build definition that you selected by default. There isn't any setting to configure this for now. You can submit a feature request on VSTS User Voice.

5
votes

I do not know if it is available in TFS 2015 Update 2 Release Management since we've already moved to update 3, but with Update 3 you can set this at the Environment level.

  1. On an Environment definition click the elipsis (...)
  2. Choose the menu option "Configure variables..."
  3. In the dialog window select "General" tab
  4. Toggle check-box "Skip artifacts download"

I don't have access to TFS 2015 Update 2, so you'd have to give it a try. Once you do this you can add tasks to manually file copy needed artifacts.

3
votes

Just released. VSTS and TFS 2018 has a new feature that might fit your needs

Previously, as part of a deployment phase, you could choose to either download all the artifacts or skip them all. Now you can choose the artifacts that need to be downloaded. This can save time by ensuring the agent only has to download what it needs. See the release artifacts documentation for more information. This feature was prioritized based on a suggestion.

https://docs.microsoft.com/en-us/visualstudio/releasenotes/tfs2018-update2#improve-release-times-by-partially-downloading-artifacts

https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/13396200-only-download-artifacts-required-for-task-executio?tracking_code=200f3ad38ab610cdbbdbb2afa5a9b7a5#{toggle_previous_statuses}

0
votes
  1. Edit the appropriate release pipeline
  2. View stage tasks for the appropriate environment
  3. Select the main Agent job, a range of configuration should become available
  4. Scroll to the Artifact download section
  5. Select the artifacts to download or not