Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS Build specific changeset and deploy it using the changeset number

Tags:

I have a Build Definition to build a solution on my TFS. This works well, but it always builds the latest version.

  1. How can I force to build a specific changeset from the past?

  2. How can I use/pass this number to the "MSBuild Arguments" to use it there for deployment?

like image 638
Konrad Avatar asked Nov 03 '11 16:11

Konrad


People also ask

How do I get a specific changeset in TFS?

Find a changeset by IDIn Source Control Explorer, press Ctrl + G. The Go to Changeset dialog box appears. Type the number of the changeset and choose OK. If you don't know the number, choose Find.

How do I download changeset from TFS?

Just copy and paste url inside your browser and you are done. If you have not previously authenticated with your TFS or VSO you will be prompted for credentials, then the file is downloaded.

How do I show changeset in Visual Studio?

you can go to the Source Control Explorer in Visual Studio and right-click on your project and select View History . This will show you the list of all changesets made to that project, who made them, the date they were made and any comment added to those changesets.

How do I check my TFS history?

Right-Click If you have the Source Control Explorer or File List open, right-click the file you want to view and select Source Control > View History. Local Toolbar In the File List, select the file(s) you want to view. In the local toolbar of the File List, click , then select View History .


2 Answers

When you queue up the build from Team Explorer, in the Parameters tab one of the Advanced arguments is get version.

Note: I think you need to specify this in the form C123 where 123 is the changeset number.

like image 76
Dylan Smith Avatar answered Sep 29 '22 11:09

Dylan Smith


The answer to your first question is clearly what @Dylan has stated.

To your second part:
The important argument is GetVersion. Navigate to activity "Run MSBuild for Project" within your Build Process Template, by default this has a value CommandLineArguments equal to

String.Format("/p:SkipInvalidConfigurations=true {0}", MSBuildArguments)

You can change it to something like

String.Format("/p:SkipInvalidConfigurations=true {0} /p:DeployIisAppPath=/changeset/{1}", MSBuildArguments, GetVersion)

and get where you need to go.

like image 31
pantelif Avatar answered Sep 29 '22 13:09

pantelif