6

Note: I'm a newb to Continuous Integration

What is the "best" approach to get these functions:

  1. Build (assemblies and web app)
  2. Testing (MbUnit or NUnit)
  3. and if it passes tests deploy via FTP to the main server (internet).

And what I mean by "best" is cheapest option, and easy to learn (low headache).

BuddyJoe
  • 69,735
  • 114
  • 291
  • 466

4 Answers4

5

I have written a pretty detailed blog post using TeamCity, and Web Deployment projects to automate build and deployment (local) here:

http://www.diaryofaninja.com/blog/2010/05/09/automated-site-deployments-with-teamcity-deployment-projects-amp-svn

I have then added to this to show FTP addition

http://www.diaryofaninja.com/blog/2010/09/21/continuous-integration-tip-1-ndash-ftp-deployment

Basically the process is like this:

  • Using a teamcity build server i download from my SVN repo
  • I build and deploy the site to a local folder on the build server
  • I fire a command line FTP client that supports scripting called WinSCP using the MSBUILD Task EXEC (http://winscp.net/)
  • Upload all my sites content
  • Have insert beverage of choice

I then make sure that i only deploy the Trunk of my SVN repo, and develop and test everything in an branch before merging - this way only tested stuff gets deployed. Add Automated testing to your build cycle and you've got a match made in heaven.

Doug
  • 6,460
  • 5
  • 59
  • 83
  • 1
    You know, this is the approach I have been taking with several large scale clients for a while and it has served me well. Team Foundation Server is great if you're in an all MS environment, but working with "mixed" company where SCM might already exist (SVN in my case), this seems to work great. The only weird feeling I get is, sure seems like MS would have an install that would do all of this? – Ian Patrick Hughes Mar 08 '11 at 18:08
  • You can use MSDEPLOY, however i find that it doesn't give you the level of control that the above approach gives with being able to script things into your build (copying custom app_offline.htm etc) – Doug Mar 09 '11 at 03:46
  • You forgot to put angle brackets around insert beverage of choice: should be :D Seriously though... awesome answer! – longda Apr 09 '13 at 23:23
2

I would go with msbuild and mbunit for the unit tests. For the FTP part google for msbuild custom tasks with FTP and you should be cooking on gas.

Burt
  • 7,680
  • 18
  • 71
  • 127
  • So just use msbuild by itself? No need for CI server? – BuddyJoe May 03 '09 at 21:46
  • You are better off learning msbuild, the build scripts are all XML based so you should be familiar with them. Once you have a build script you can hook up cruise control. That is the way I would fly. – Burt May 04 '09 at 00:35
1

I have historically used CruiseControl, which has worked just fine, but I also heard good things about TeamCity. Regarding FTP tasks for MSBuild (which is definately the way you want to go), there are some to find on the net. When I checked last time (which was not quite recently) all that I found had one or another shortcoming, so I ended up writing one myself (wrapping the FtpWebRequest in .NET). While that might not be the best FTP implementation around, the task provided the functionality I needed (upload of directory structures, remote delete). I guess there might be tasks available today providing that functionality (otherwise maybe I should just publish mine...)

Fredrik Mörk
  • 155,851
  • 29
  • 291
  • 343
0

We do the same thing with Zed Builds and Bugs Manager from Hericus Software.

We have to combine the .Net assemblies with C++ dll's and package the whole thing together into a Java installation (imagine that confusion :-) ). We also use FTP to upload some components of the build (not the whole thing) to other systems that need pieces of what the build produces.

After everything has all been rolled together, the nice thing about the Zed server is that it becomes our system where everyone knows where to get their artifacts from. It handles promotion from Dev to QA to Production, and tracks the builds through this lifecycle.

Steven M. Cherry
  • 1,355
  • 1
  • 11
  • 14