Current Landscape
I recently started looking into what it would take to use Team Foundation Server to run automated builds and deployments of SharePoint projects.
There's quite a bit of material out there that demonstrates how to use Visual Studio to create deployment packages for SharePoint solutions, e.g. using a build target to have MAKECAB create a WSP for a custom SharePoint solution.
However, there's little to no material that shows how to get TFS to do this for you. Ideally, I would like to queue up a new Team Build, have TFS compile my code and create a WSP for my SharePoint solution, and finally deploy it to a selected SharePoint environment.
The stuff I've found makes flawed assumptions, such as having SharePoint and TFS on the same server. Umm, no.
This is getting more important as large companies turn to SharePoint as an application platform. Some of these companies have to comply with regulations such as Sarbanes-Oxley, which call for separating the roles of people who develop and deploy the software.
Lack of Guidance
Frankly, I'm disappointed in the lack of guidance from Microsoft on this subject. Articles are only recently starting to appear on MSDN about the importance of application lifecycle management practices for custom SharePoint applications.
The problem with these is that they tell you what you should do, but not how to do it! It's as if somebody just realized that this is important.
I have no doubt that this guidance will be available soon, I'm just amazed that it took so long.
Why is this Difficult?
How did it get to this? Well ... when building SharePoint projects, developers just weren't considering the "deployability" of their code.
Tools like the Visual Studio Extensions for WSS hide this issue from the developer. F5 deployment to SharePoint, WOW! Deployment managers were still tapping out stsadm commands to deploy features and solutions into SharePoint.
Getting TFS to do this for you also gets a little complicated. The TFS server performing the builds needs all your solution's dependencies, e.g. all the SharePoint dlls you might be using. You end up having to include these in your solution so that they are available to TFS when compiling.
Also, if you don't have TFS and SharePoint installed on the same server (and who does?), how do you deploy your solution to the SharePoint farm.
I don't have the answers, I wouldn't be writing this post if I did :)
I've seen some promising tools such as SPALM, which use the Microsoft Guidance Automation Toolkit to create a SharePoint software factory. I have to play around with this a little more, but it looks like the most promising tool out there.
What's Next?
I'm going to working on this over the next two weeks, and plan to share my findings.
We also have a Deployment and Packaging session happening at MOSSCamp 2008 in a few weeks. I will share all my learnings - successful or not - in that session.
If we have something working, I'll be sure to post it to the MOSSCamp CodePlex repository.
Let's Hear about your Experience
Are you doing this in your organization? I'd love to hear about what other people are doing.