views:

118

answers:

6

We currently build our .net website in C# in Visual Studio 2010 Pro on our dev server, then manually publish it and upload to the live server where it is copied over the current files to go live.

We want to automate this process as much as possible and if possible push it at a certain time, such as every day at midnight. We don't currently use any Source Control so this probably makes it essential anyway...

Is Team Foundation Server [TFS] the best solution to enable this? If so, how much would it cost our client for this or how can we find out? We're in the UK and they do have an MSDN subscription.

+2  A: 

Sounds like you are after a Continuous Integration (Build) server. One I have used a lot with .net is Hudson.

You can kick off a build by a number of triggers such as at a particular time and can run various steps in sequence. These can include running batch commands (windows or linux depending on what platform you run it on) or running MS Build. It has a lot of plugins and most major tools are supported.

A common sequence for apps that we build is:

  • update from source control (but that doesn't mean you can't do something like take a copy from a file share)
  • Compile using msbuild
  • run unit tests using nunit
  • Deployed built project to test server
Dean Johnston
A: 

Well team TFS is the ultimate solution. But, to reduce cost you can make use of MSbuild to achieve your task. You can create a windows scheduler which fires MSBuild at a particular time. There is an open source MSBuild task available at http://msbuildtasks.tigris.org/ through which you can even upload your files through FTP

ajay_whiz
TFS is free if you have MSDN, and can run on Windows 7 if you realy wanted to cust any costs to the bone.
MrHinsh
+1  A: 

If you client has MSDN then TFS is free!

Wither you have MSDN Professional, Permium or Ultimate you get both a CAL to access ANY TFS server and a licence to run a TFS server in production included. You just need to make sure that all your users have MSDN. If they do not, then you can buy a Retial TFS Licence for $500 which allows the first 5 users without a CAL. You can then add CAL packs which are cheaper than MSDN for users who need access to the data. If you have internal users that need to access only the work items that they have created, then they are also FREE.

As long as the person that kicks off the build has an MSDN licence your build server is also free. You can have the sequence that Dean describes, but I would sugest shelling out a little cash for Final Builder and use it to customise the process. It it integrates well into TFS and provides a nice UI.

The advantage is you get Dev->test->Deploy all recorded, audited and reportable in one product...

http://www.finalbuilder.com/download.aspx

MrHinsh
-1. TFS is most decidedly *not* free, in any sense of the word.
Dave Markle
Not sure why you -1 this. CALs are most certainly included in certain versions of MSDN.
Robaticus
CALs might be included for many versions of MSDN, but they're not included in *all* versions. And the server certainly is not free, especially the versions that do the whole app lifecycle management.
Dave Markle
If you have MSDN Pro / Premium or Ultimate you have a full licence to run both the TFS Server and a CAL to access any TFS server.So EVERY version of MSDN gets TFS both server and client for free.
MrHinsh
Dave what you are referring to is prior to the MSDN subscription updates that occurred in line with the VS 2010 release. MrHinsh is correct.
Ryan Cromwell
OK, yes, you have a basic CAL with the Pro edition now. But the full server is most definitely not free. And only the Pope himself can afford the Ultimate edition. And the CALs for web access to projects (for things other than trivial use cases) are not free. Yes, they have some lower cost solutions if you just want source control, but why do that when you have your choice of truly best-of-breed, mature cross-platform SCC providers (svn, git) which are flat out better?
Dave Markle
(sigh) Dave the Server is FREE if you have an MSDN Licence, realy it is... see http://blogs.msdn.com/buckh/archive/2009/10/20/tfs-2010-server-licensing-it-s-included-in-msdn-subscriptions.aspx
MrHinsh
+1  A: 

TFS Team Build is certainly capable of doing what you wish by setting up a Build which executes the Deploy target of a Web App. The key is MSDeploy which in reality can be executed in many ways and is not dependent upon any one tool. You could simply schedule a task to execute MSDeploy.

See these two links for more information:

http://weblogs.asp.net/scottgu/archive/2010/07/29/vs-2010-web-deployment.aspx

http://www.hanselman.com/blog/WebDeploymentMadeAwesomeIfYoureUsingXCopyYoureDoingItWrong.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+ScottHanselman+(Scott+Hanselman+-+ComputerZen.com)

There are a lot of really cool things you can do with the new Build system based on Windows Workflow in TFS 2010. Learning to customize your Build Process Templates is a worthwhile investment.

Ryan Cromwell
+3  A: 

At this point, you need to slow down and set more realistic goals. Here's my biggest red flag:

"We don't currently use any Source Control so this probably makes it essential anyway..."

Without proper SCC, you're not capable of getting where you need to go. A full scale TFS implementation can most certainly do what you want to do, and it has a couple of really nice features that you can use to integrate automated deployment scenarios, which is great, but you really need to learn to walk before you can learn to run.

I've commented on TFS cost before, so I won't do that in this post, but suffice it to say that a TFS implemenation which does what you want will cost a significant amount of money, especially if you factor in the time it will take you to set it up and script out the automated publishing workflow you want.

I don't know what your budgets are or how big your teams are, or the nature of your development strategy, or a number of things that might actually change my answer, but I'm proceeding on the assumption that you have a limited budget and no dedicated staff of people that you can draw upon to set up a first-class TFS implementation, so here's what I would recommend (in this order!)

  • Set up version control using something that's free such as Subversion or Git. For an organization that's just starting off with SCC, I'd recommend Subversion over Git, because it's conceptually a lot simpler to get started with. This is the bedrock of everything you're going to do. Unlike adding a when fuze to a 2000 pound bomb or assembling a bicycle, I'd recommend that you read the manual before and during your SVN installation.

  • Make a build file using MSBuild. Yes, you can use nAnt, but MSBuild is fairly equivalent in most scenarios, and is a bit more friendly with TFS, if you ever decide to go in that direction in the distant, distant future. Make sure your builds work properly on your development boxes and servers.

  • Come up with a deployment script. This may very well just equate to a target in your MSBuild file. Or it may be an MSI file -- I don't know your environment well enough to say, but guessing by the fact that you said you copied stuff over to production, an MSBuild target will likely suffice.

  • Set up a Continuous Integration server such as Hudson or CruiseControl.NET. I personally use CruiseControl, but the basic idea behind both is that they are automated services which watch your SCC system for changes and perform the builds for you. If you have set up a MSBuild target to perform your deployment, you can configure a "project" in CCNET (or probably Hudson) to do the deployment as well.

The total software cost of these solutions is $0, but you will likely face quite a bit of a learning curve on it all. TFS's learning curve, IMO, is even steeper, and the software cost is definitely north of $0. Either way, the take away is not to try to bite it all off in one chunk at one time, or you will probably fail. Go step-by-step, and you will get there. And have fun! I personally loved learning about all of this stuff!

Dave Markle
With Visual Studio 2010 the TFS server comes free with ALL versions of MSDN
MrHinsh
A: 

You need to do Continuous Integration. TFS 2010 is fully capable to do this for you. But before you continue you should move your sources to TFS Source Control Management. We are doing same thing as you need: All our sources resides in TFS, with each check-in, a build occurs in Build Server then deployed to a remote live server.

afsharm