Local Solution file path in CruiseControl - Can it be automated? - continuous-integration

Ok, I know this is not a programming question.. but I'm sure its related to improving productivity of programmer.
I am trying to use CruiseControl http://cruisecontrol.sourceforge.net/ to implement continuous integration in our work flow. Each developer has separate machine to develop with.. with one centralized db server. We work mostly with Visual Studio to develop asp.net applications. And we have a centralized SVN server on the same system we're having db server.
Now I'm trying to integrate Cruise Control, but not sure what is the best way. I am particularly not able to decide...
In solution file path, do we need to pass a local path? So, in that case should we copy a one copy of project source code on server to execute? Or is there any better automated way to achieve this? Can we use SVN URL in solution file path...?
I'm sure there is must be a way to do this fully automated, but how?

In the project build node you will need to define the local path for the build server and the SVN URL so CruiseControl can grab the code from the centralized SVN server. You can use NANT or MSBuild plugin to define specific configurations for the build server to avoid mis configuration with the server. Below is an example of the ccnet.config file that need to be defined in the build server
<project name="Calculator-Service">
<schedule type="schedule" sleepSeconds="15"/>
<modificationDelaySeconds>2</modificationDelaySeconds>
<sourcecontrol type="svn">
<trunkUrl>svn://svn.mycompany.com/myfirstproject/trunk</trunkUrl>
<workingDirectory>C:\ccnetexamples\eci\working\service</workingDirectory>
</sourcecontrol>
<build type="nant">
<executable>C:\ccnetexamples\eci\working\service\tools\nant\nant.exe</executable>
<baseDirectory>C:\ccnetexamples\eci\working\service</baseDirectory>
<buildFile>nant.build</buildFile>
<targetList>
<target>ci</target>
</targetList>
<buildTimeoutSeconds>300</buildTimeoutSeconds>
</build>
<publishers>
<xmllogger>
<logDir>..\web-service\log</logDir>
</xmllogger>
</publishers>
</project>

look at
http://www.cruisecontrolnet.org/projects/ccnet/wiki/Configuration
There is a step by step guide for Build Server Scenarios.
with build script and ccnet.config examples.

IMNO, the best way to think of CC.NET is a "super fancy msbuild.exe" executor.
Write a msbuild (.proj) and put the majority of your logic in it.
Including "pull code down from svn and place it in this local directory"
Then you cc.net task will pull down this .proj file....and then use the msbuild.exe task to execute that .proj file.
Since you only have a very small amount of logic in the cc.net proprietary tasks, if you pick another CI tool, its not a hard transition.

Related

Using Team City with NAnt for .NET

I am starting to use Team City, I would like to add NAnt to build my .NET projects and also a way to run sql files from a folder. What is the best way to achieve this and is there a tutorial for this?, or what is the best way to do this?. I checked on google but I quite do not understand the process or where to start. I have team city installed and nant. If anyone could point me in the right direction I would appreciate it.
Teamcity comes with a NAnt runner: http://confluence.jetbrains.com/display/TCD8/NAnt
The best way to make it work is:
- build your own script
- test it on your own machine, without teamcity
- commit the script into source control
- configure teamcity to run it using the NAnt runner
this way in case of future troubles you can always debug your script locally.
Hope it helps.

Publish a specific revision using CruiseControl.Net

I am setting up a CruiseControl.Net server. So far, it only builds a project (.Net website), and I kind-of know how to set up unit testing, code coverage, etc in the future.
What I will need to have soon is this:
The developers commit changes to SVN continually, thus CCNet builds often.
CCNet will publish the latest version to the development server, as soon as a commit is validated (with unit tests etc).
The project manager validates a specific version, in order to publish it to the pre-production server, and create a SVN tag from this revision.
The last point is where my problem lies: how exactly can I set up things so the project manager can, for instance, browse to the CCNet web dashboard, select a previous specific build, and says "this is the build I want to publish" ?
I believe that my thinking is flawed somewhere, but I can't put my finger on it. Maybe CCNet is not the right place to do these manipulations ?
In my mind, I can create a SVN tag using CCNet, and mostly work from the trunk, but maybe I can't ? Maybe it's the other way around, and I should add a CCNet project every time a tag is created under SVN ?
The final goal is that I want to automate the publication process: zip creation (for archiving), web.config modification (using Nant for instance), and website publication (using FTP).
In all these steps, I want to limit the manual intervention to the maximum. If I can avoid to add a new project to CCNet every time a tag or branch is created in SVN, that would be awesome.
Thanks for your help, and sorry if it's not very easy to read, but it's not very clear in my head either...
Since you can create any task, you should be able to achieve the goal, though unfortunately not out-of-the-box.
Since you use SVN, it all depends actually on revision. I think I'd create a separate project for your third scenario and added a parameter where PM would provide revision number. Then based on that I'd tag sources etc. in my own task.
Regarding the other points, I think this is similar. Recently for web projects we started using MSDeploy, and in each stage build the MSDeploy package was created. Then there was a separate build called Deploy, that when forced allows us to select which package we want to deploy using MSDeploy.
Having several environments, however, started a little bit like overkill for managing with CCNet, and I'll be looking into kwakee at some time.

VS2005, VSS - Check-in + Deploy automatically

I'm stuck working with VS2005 and VSS for some of the code that I'm working on. Are there any scripts that let me commit all modified source files to VSS and make VSS push out a patch to our QA servers?
Thanks,
Teja.
Have you considered CruiseControl.NET to manage your build and drop?
It sounds like you wanted a bit extra ("scripts...commit all modified source files"), but CC.NET will take care of building/reporting/deploying. It's not clear from your question where the commits will be coming from (a developer machine, somewhere else), or why automated check-ins are useful. In other words, shouldn't developers be purposefully committing code changes?
How to Setup CruiseControl.NET.
Sounds like you're looking for a Continuous Integration server, which allows you to run build scripts after detecting changes in source control. Try TeamCity or CruiseControl.NET.
Here's a walk through that details the setup process for CI with TeamCity and Subversion. You can add additional scripts for deployment via MSBuild or any command line tool.

How does one version control the configuration of a TeamCity project?

In my CruiseControl instances, I have version controlled the ccnet.config file.
When I want to update CruiseControl, I run an "update config" job which fetches the config from version control.
In this manner, the very build process of a release is configuration managed.
I am wondering how to achieve these goals effectively under TeamCity.
I try to keep what ever CI I am using as light as possible and put as much of the running of the build into an msbuild or nant script including running tests, code coverage, etc.
The benefit of this is:
The build file is version controlled.
You can run the script in any environment.
Easier to move between CI environments.
Everyone becomes responsible for the build.
This has been introduced in TeamCity 9. Also answered in another post:
Version control (e.g. in TFS) build configuration for TeamCity - is it possible?
I've been wanting a way to source control TeamCity config for a long time. I ended up writing a Windows Service which monitors the configuration directory and commits changes to git.
The project is on GitHub: https://github.com/grenade/teamcity-config-monitor
You might try looking at the folders that are backed up prior to upgrade (or when restoring team city) as those represent the configurations and changes you've made since initial installation.
http://confluence.jetbrains.net/display/TCD4/TeamCity+Data+Backup
Some of the relevant data is actually a database, (and in fact the documentation advises you to point team city to a real database like mysql instead of the default embedded database it uses)
You could try checking those into SVN, but you'll want to stop team city for any check-in actions.

CruiseControl.NET, Visual Studio & SubVersion

I am setting up a Continuous Integration server.
I have one issue that doesn't seem to be mentioned in the tutorials.
I have a ASP.net Web Application that I need to compile and them publish.
My Problem is that I seem to be able to compile the app but when I attempt to use a buildPublisher this copies every thing including .svn files & folders and ms CS files.
I am using an MSBuild task to compile my source. I tried setting my MSBuild Output Directory to directory but this didn't seem to have any effect.
What am I not understanding?
Thanks
You're probably looking for the _CopyWebApplication directive:
http://blogs.msdn.com/nmoreau/archive/2007/01/26/deploying-web-application-projects.aspx
We use CruiseControl.NET to deploy our ASP.NET applications to our test servers for the QA department so this is indeed possible.
In each project we created an additional build configuration called 'Deployer' which is identical to the Debug configuration with the exception of building an additional Web Deployment Project. So by running MSBuild in the Deployer configuration we can generate our compiled output in a known location.
We then use NAnt to perform a simple copy operation to the required location, i.e. into a folder where our IIS server is configured to look for the applications.
I know you don't mention NAnt in your question but it's well worth getting familiar with it if you want to get the most out of CCNet.
I'm not at work at the moment but if this makes any sense and you want some additional information then let me know and I'll pull some more information together.
Hope this helps
Are your bin or obj folders checked into svn? if so that would contribute or possibly cause this issue.
Because those folders shouldn't have any svn folders/files
You can configure SVN to call the .svn folders _svn instead.
Set the SVN_ASP_DOT_NET_HACK environment variable.

Resources