On the project that I'm currently working I have a requirement to run a shell command over some static files prior to check-in into TFS.
Is it possible to use TFS checkin policies to force a developer to run a shell script prior to check-in?
On the project that I'm currently working I have a requirement to run a shell command over some static files prior to check-in into TFS.
Is it possible to use TFS checkin policies to force a developer to run a shell script prior to check-in?
In the end we didn't need to use a Checkin policy.
Instead we turned the resolution on its head as I found that running
tf.exe checkin
from a command prompt, without any further arguments, causes the TFS checkin dialog to popup.This means that we can add an additional step at the end of our shell script that runs:
Check-in Policies are designed for this purpose: to check for something in order to "authorize" the check-in.
You'll find an interesting video here about how to develop one. You'll see that it's really easy and once you did your first you will want to customize more TFS.
In you case you will have two options (IMHO):
The first should be the best but it bothers me a bit because it's not the true purpose of the check-in policies to perform a task upfront, but I can't think about why it shouldn't work. And maybe you'll have to go that way it the second solution is not possible.