Question

This might be an easy problem, but I am a bit stumped.

I am customizing a TFS 2013 build process to do our brand of versioning, and one of the steps is to apply a label that includes the version just built.

The new 2013 workflow applies a label when it gets sources. To build the custom label, I need the sources to establish the version, as we let the development teams manage their major / minor version parts according to features and fixes. I can easily suppress the automatic labeling; it doesn't appear all that easy to apply the customized label after the fact.

Earlier versions of the Team Build workflows exposed the Workspace and Build Agent context which made this easy. 2013 appears to have encapsulated all this in the new activities.

The LabelWorkspace activity looks correct, but I am having trouble locating Scope and Workspace required values. LabelSources could work as well but appears to be too granular for this purpose.

Regarding GetWorkspace, the documentation online isn't too clear regarding the behavior of this activity, and I don't like the idea of getting all sources redundantly just to acquire a handle on the ambient workspace. I may be misunderstanding this activity.

I also don't like the idea of using the TFS API directly to pre-emptively round trip to get what will be a local file and a known version later in the build process, meaning, I don't want to do labeling at the point in time it is done in the new workflow if it can be avoided, because it appears this will be a lot of redundant code and compute.

Anyone know a direct and easy means to wire this up?

Was it helpful?

Solution

As mentioned above, as of TFS 2013, I am finding it MUCH easier to use PowerShell scripts, versus editing XAML/workflows.

All you do is add a PS1 file to your source control, and link it to the Build Process in the PRE or POST build.

OTHER TIPS

You will eventually find it much more efficient to create script hooks into your templates and simply run the "tf label" command in your script. There are powershell activities that you can drop in your templates or activities to invoke other kinds of processes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top