Build by changeset date - tfs

I'm new to the TFS Build and I'm wondering if I can include in my manual build only those change sets which are not later than date such-n-such.
The general task I'm trying to solve is to build a past release which I did a frozen on date, say, March 1st and omit a recent changes. No branching I do with my project.
Maybe there is a better way to do that?
Thanks.

You can do it when you queue the build.

There is no changeset date concept in TFS expect the creation date of changesets on the same day. Usually we queue a build from a specific changeset in TFS.
You can achieve it by specify the changeset info in Source Version of queue build dialog such as C8 which will build changeset 8. More detail explanation please see below screeshot.
Note: This function is released with TFS2015 update2 for vNext build. To use it, you have to upgrade to Update2 or above.
You could also build a label, how to create take a look at: Use labels to take a snapshot of your files

Related

Delete Old Builds

In TFS 2010/2015, the Xaml builds can be configured to only ever keep the last x builds (e.g. keep the last 5 builds).
However, the new style builds in 2015 change how this works, to keep builds for x number of days, and keep a minimum of y.
This might work well when dealing with small projects, but the output of our build is >5GB a time.
Is there a way to use the old retention policy, or alternatively have TFS manually delete the old builds as new ones are created?
XAML and vNext are totally two different build system. You definitely couldn't use the old retention policy on XAML build for vNext.
And there is also not any option to make TFS delete the old builds as new ones are created. Retention policies is the only way used to configure how long builds and releases are to be retained by the system for now.
As a workaround, you could use TFS API to do this. You could run a utility to clean the build artifact drop location for builds. Here is a sample from skundu's answer in this question: TFS 2015 - Delete Build Artifacts for your reference.

TFS 2015 vNext force build number

Back in TFS 2013 you could temporarily hardcode a build number and then switch back to auto increment to skip ahead with build numbers. Now with TFS 2015 vNext, it seems like I can no longer do this. I went to make a new build definition and wanted to carry on from the last build number from my XAML build but it wouldn't move up.
Any ideas or workarounds for this?
It's also supported. Please check this link for detail steps:Generate custom build numbers in TFS Build vNext
update
Unfortunately, it's impossible.$(Rev:.rr) Its start by one.
What is $(Rev:.rr)?
To ensure that every completed build has a unique name. When a build
is completed, if nothing else in the build number has changed, the Rev
integer value is incremented by one.
Source:MSDN

TFS 2015 one build for all branches

We have lots of feature branches, and we don't want to manually create a build definition for each of them for continuous integration.
Is it possible to create one build definition in TFS Build 2015 that will build solution from the branch when code is checked in to it? We are using TFVC for source control.
Preferably, only the active branches should be downloaded to the build agent, as we have a lot of old branches that don't get any check-ins.
There is a similar question about old TFS Build system, but since build system was completely changed in TFS 2015, the answer would be different too - TFS build, one build for many branches
Short answer: No.
This works for Git, not for TFVC, unfortunately.
Actually, it would appear to work out of the box with TFS 2015 Update 2, according to a test I just ran with the following simple structure...
$/Project
$/Project/Product1/Solution1/
$/Project/Product1/Solution1/solution1.sln
: (and everything below it)
$/Project/Product1/Solution1-branch/solution1.sln
: (and everything branched below it)
$/Project/Product1/Feature2/another-solution1.sln
: (and everything below it)
Build settings:
Build tab | Solution should be "**\*.sln", Repository tab | Repository should be "Project" and Mappings should include "$/Project/Product1/".
The ** in the Solution field causes it to search recursively for *.sln files, which it then builds in sequence.
I just tried this and it built all branches one after the other.
Excluding "old" branches might be more difficult if you use the single recursive approach, but you could always simply list the desired branches in the Mappings area - the nett result should be the same.
Hope that helps.
If I understand your question, this might work for you.
This will build all feature branches, plus the develop (default) branch as part of CI.
Not sure why, but if you reverse the order of these it does not work.

TFS Build specific changeset and deploy it using the changeset number

I have a Build Definition to build a solution on my TFS.
This works well, but it always builds the latest version.
How can I force to build a specific changeset from the past?
How can I use/pass this number to the "MSBuild Arguments" to use it there for deployment?
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.
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.
If you use the changeset number, then it will only make sense for CI builds, since they typically build a single changeset.
For any other kind of build, I recommend using the build ID, which is unique, and covers the case of a build that builds multiple changesets.

What does changing TFS Build Quality do exactly?

This question is a bit round about, but I'll get to that in a minute. When someone changes the build's quality in TFS (we're on 2005) what exactly happens? Does this affect changesets or workitems, notifications??
Now the reason I ask: I want to be able to generate a changeset list between builds. As such selecting a build on Jan 1 and comparing it to a build on March 29, I want all the changesets between those builds. Perhaps there is another way to do this but I do think the build is the starting point.
Out of the box, it's just meta data about the build. The intent being you can use it in your development process to indicate when a build has progressed through certain quality gates.
It should be noted that the open source TFSDeployer project relies on the build quality as a trigger mechanism to run deployments scripts.
In TFS 2012, you can set a quality threshold on builds to say which ones can be used by Microsoft Test Manager for testing.
In MTM, in the Testing Center, under the Plan tab, under the Properties subtab, there is a section called Builds. You set a quality threshold with "Filter for builds" and then any builds that conform to the filter will show up when you click Modify under the "Build in use" line.
On a side note, I have found some interesting info here about automatically updating build quality through XAML.
I think it is just a notes field. I see it show up on some reports, but nothing else of value.

Resources