Question

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).

Was it helpful?

Solution

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.

OTHER TIPS

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.

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...)

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.

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