Setting up CI with TeamCity with Git & NAnt
Asked Answered
A

2

8

We're moving away from TFS as a source control/build service.

We're now using TeamCity, and hosting our source on Git via BitBucket.

Can anyone point me to a decent article, blog, existing Stack question with a basic outline of the steps here to get a CI configuration up and running?

I've got a basic project setup in TeamCity, got it pulling the source from Git, but i'm trying to figure out how to setup NAnt as a build step to compile the code and publish it to my IIS website.

Any advice?

Just to be clear, the setup:

  1. Build server = TeamCity
  2. Source Control = Git (BitBucket)
  3. Application = ASP.NET MVC 3 Web Application
  4. Web Server = IIS 7

Appreciate any pointers.

The closest thing i've found it this: http://thecodedecanter.wordpress.com/2010/03/25/one-click-website-deployment-using-teamcity-nant-git-and-powershell/

But that involves the web server pulling the code from Git using powershell. I don't want that. I want TeamCity to pull the Git code and publish directly to my web server.

Aggrandize answered 18/3, 2012 at 23:34 Comment(1)
Hi, I'm the author of the code decanter article you linked to. I just thought I'd explain the rationale for the pull rather than push mechanism. In our scenario we wanted to be able to spin up additional servers on Amazon EC2 to deal with heavy loads. With a push-based mechanism this would involve reconfiguring teamcity every time a new server was brought online. With a pull-based mechanism the teamcity server doesn't need to know the IPs of the various webservers so it requires no additional configuration.Subarid
A
8

Got it working (with MSBuild - not NAnt, for now) thanks to this excellent blog series.

Aggrandize answered 21/3, 2012 at 6:16 Comment(0)
P
0

Here's an article on article on how to mimick AppHarbor (which seems to be what you want), although you might want to consider just going for the real thing.

Peck answered 19/3, 2012 at 1:26 Comment(5)
But that's using Rake as the build runner with MSBuild. I don't want to install Ruby on the build server, and i want to move away from MSBuild.Aggrandize
As long as you are using Visual Studio to program in, you are using MSBuild to build your code.Studner
@frism, @Studner - what about aspnet_compiler.exe, or csc, which i believe is what NAnt uses. Or am i wrong? Do you have to use MSBuild with NAnt to build a .NET Web Application?Aggrandize
No, but Visual Studio uses MSBuild internally - every VS project is a valid MSBuild script. So why don't you use what you already have? In my opinion, a good CI setup is running a build as close to what the developers do as possible.Studner
@Studner - okay, i take your point. I know that VS uses MSBuild. There are just some extra deployment steps that i wanted to do, which i'm pretty sure MSBuild can't do, and if it can, it will be a pain in the a$$ to do, like most of MSBuild.Aggrandize

© 2022 - 2024 — McMap. All rights reserved.