TFS2017 Release Management TFVC Artifacts Source - only a changeset - tfs

On the Artifacts tab of the release definition editor I can choose as artifacts source type the "Team Foundation Version Control" in the Link an artifact source pop-up.
According with the documentation it's possible to specify a certain changeset to be used as a source:
When you link a TFVC branch, you can specify the changeset to be
deployed when creating a release.
But in the editor is possible to select only the root (e.g. $/FooBarProject).
How can I specify to download only a specific changeset? I don't need to download the entire repository when I need just one script.
TFS Version 15.112.26301.0

When you specify a changeset, you're specifying a specific changeset for the entire repository. There's no way to conditionally restrict it to just the contents of that changeset.
If you need a specific file or subset of files, you should publish it as a build artifact.

Related

Team Foundation Server TFS Build triggered from Subversion SVN Tag

I'd like to be able to trigger a build in TFS Build when a developer tags in Subversion. I'd also like to use the tag number as part of the build and release name. Is this possible in TFS right now?
There is no this built-in trigger for building a repository type of subversion in TFS.
You could first get the event (a developer create a tag in svn) from SVN. Not sure how to do this in SVN, should be something like the service hooks in TFS. Then trigger a build in TFS 2017 using REST API. How to do this please refer: How to trigger a build in TFS 2015 using REST API
As for how to use the tag number as part of the build and release name, see below:
Create custom build number during build
With Team Build you can update the build number at any time during the
build by outputing "##vso[build.updatebuildnumber]1.2.3.4" to the log
during the build.
You can see the full list of logging commands here https://github.com/Microsoft/vso-agent-tasks/blob/master/docs/authoring/commands.md
This will update the build number & name.
The down side that you have run into is that you can no longer use the
auto-incrementing number that you have been trying to use. You need to
come up with the version number yourself, and then pass it back using
the output above.
Source
Add two more related blogs:
vNext Build Awesomeness – Managing Version Numbers
Generate custom build numbers in TFS Build vNext

How to maintain history when TFS branch is created

I am creating an new branch from existing branch using Source Control Explorer (TFS) in Visual Studio 2012.
I can't see any history from the original branch in the new branch.
Is there any way to force copy of original branch history?
The new branch contains the history of original branch. You need to check history for a single file (not a folder), then you should see the history:

How to change TFS Project version

How to change TFS project version and how to use old versions.
I explain my question with an example.
I have a number of projects in solution name is TestSolution.(Suppose solution version is 1.0)
I create publishing file of the solution suppose 10-Dec-2013 and publish to Client (we are changing version 1.0 to 1.1).
After that we are modifying the project, On 15-Dec-2013 the client asking for a small change that change will fit in Version 1.0 then we need to create a new publishing file on Version 1.0. Is it possible on TFS 2010? And merge the change form on Version 1.1?
Yes, you can branch a directory in source by date or changeset.
To branch by date or changeset:
1.In Source Control Explorer, right-click the folder or file that you want to branch, point to Branching and Merging, and then click Branch.
The Branch dialog box appears.
2.In the Target box, modify the location and name for the new branch.
You can also click Browse to specify a target.
3.In the Branch from version section, click one of the following options in the By list:
If you click Changeset, you can specify the number of the changeset in the Changeset box. As an alternative, you can click the ellipses (…) to open the Find Changesets dialog box.
-If you click Date, you can specify a date in the Date box.
I would suggest you look at using labels on your source when you release. It gives you the ability to have an exact marker of your source to branch from in the future if needed.

Team foundation CI build watching specific branch

How can I setup an automated TFS build which would fire up only when check-in occurs in a specific branch of the project as opposed to on every single check-in across the team project?
In the Team Explorer there should be a folder "Builds" for your team project.
Right click, then choose "New build definition" from the context menu.
Set the trigger to whatever you like, e.g. gated checkin.
On the "Workspace" tab you can now choose for which workspace the build applies. Here you can choose the server path of a specific branch. Set this to the server path(s) you want the build to trigger on.
On the process tab you can choose which solution to build.
Hope that helps.

Team Foundation Server - How to team build a Team Project but not pull all branches

Currently we have a team project setup like below (in regards to branches)
Team Project
|__Developement
|__Development - Isolated Feature Dev
|__Main
|__Production
The issue that i have, is that when we want to do a team build on the production branch solution, it copies the entire team project down to the build server (so 4x copies, 1 for each branch) As the project is rather large, and the other branches are not required to be built, i'm wondering if there is any way to only build the single branch required?
When you configure the build, on the workspace tab, choose the correct branch in source control.
If you only want to check out the Development branch, configure the build to check out
$/Team Project/Development
If you want to check out a particular folder, but not sub-folders, you can 'Cloak' the sub-folders. Right click on the build from Team Explorer, chose "Edit Build Definition", and click the 'Workspace' tab.
From there you can cloak/add as many folders (branches are just folders) from as many places as you like

Resources