I have a default nant build that runs on every checkin in CC.net. What I would like to do is on a nightly schedule run a different nant task under the same build that would do a clean checkout of the codebase for the next day.
Is this possible with cc.net? I've done it with TeamCity and I'm rusty with cc.net as I haven't used it in awhile.
CruiseControl.Net will pass the build trigger condition to you NAnt script. So your build can invoke different targets based on property CCNetBuildCondition being set either to "IfModificationExists" or "ForceBuild".
Yes. You can create a new project in CruiseControl that runs your normal build or you can have it run a separate build (per your needs). Then schedule this project to run at a specific time (morning).
Try this: http://cruisecontrol.sourceforge.net/main/configxml.html
Or this: http://confluence.public.thoughtworks.org/display/CCNET/Schedule+Trigger
I think what you're looking for is setting up the triggers to a preset time. There is this settings. Example below from the CC.NET site.
<scheduleTrigger time="23:30" buildCondition="ForceBuild" name="Scheduled">
<weekDays>
<weekDay>Monday</weekDay>
</weekDays>
</scheduleTrigger>
You can do a build when you want, if you didn't want to do the whole thing at once you could make projects with that trigger that focused on smaller aspects of your code. That is how you make CC.NET start a build at a given time.
More info on Schedule Triggers at confluence's site
Related
I maintain a classic asp web application, and I'd like to try to automate some of the merging to and from branches using CruiseControl (CruiseControl.net specifically). But I don't have any use for a build tool. Basically I would want a commit on /trunk to automagically get merged to a bunch of feature branches that would exist as CC projects.
Is this possible/recommended or is there an easier way to do this?
Some parts of the repository do contain VB6 or .NET code, so I would like to be able to automate builds to those parts in the future, but for the time being I would just basically be using it to automate keeping my static website clean.
It is not the normal responsibility of CruiseControl to affect source control, short of tagging commits. You could have another, say release, branch that CruiseControl monitors. The merging can then be done manually to this branch as required - resolving any merge conflicts at point of merge. CruiseControl would then just 'build' these merge commits.
CruiseControl is a basically a tool for executing commands in a given order based on a trigger. In your case a SourceControlTrigger.
You can setup CruiseControl to execute msbuild, or not, as required.
As you are trying to deploy/package a classic asp site, I guess you only need to copy/zip the source files and deploy them to your web server. This can be achieved as so:
Use nant to copy, and zip, your source files, execute it via an nant task
use curl, executed via an exec task to send the zip file via http(s)
If required you can preceded this with an msbuild task to build your .net projects.
I'm using cruisecontrol.net to do CI, but the test type is configured in an xml file is not what I want. The xml file looks like:
<config>
<Test type="A"/>
</config>
Is there any way to change it from A to B?
I would switch mentality a bit.
Think of CC.NET as a "super fancy msbuild.exe executor".
Write most of your logic in msbuild files. Then you can easily find XmlPeek and XmlPoke (XmlUpdate) "extension tasks" that are tried and true.
This has some advantages. If you ever switch from CC.NET to something else (TFS for example), having most of your logic in an msbuild (.proj) file will make that transition very easy.
The more "proprietary" tasks you write that is CC.NET specific, the deeper you get in.
I go with this:
Have CC.NET download your .proj file.
Have CC.NET excecute msbuild.exe yourfile.proj.
Have CC.NET "merge" all resulting xml.
Have CC.NET run its "publishers" (email being the most popular)
Your .proj file will have the majority of logic.
It will pull down the rest of your code.
It will build the code.
It will zip up files or create installers or whatever.
This will serve you better than trying to get CC.NET to do everything.
I don't think there is CC.NET xml-update task.
Msbuild Community Tasks has ~lots of extra tasks to get done what you want to get done.
Yes there is with parameters. See this page:
http://cruisecontrolnet.org/projects/ccnet/wiki/Parameters
When someone forces a build a dialog pops up allowing them to choose between test type A and test type B.
How can the same Jenkins Groovy Postbuild Plugin step be added to all jobs? We have 50+ jobs, so it is too hard to copy-paste the link to desired groovy code to every job.
I usually do similar mass changes by updating the config.xml of the effected jobs. Every good editoru should have a search and replace function that works on files. use the following workflow.
shut down Jenkins
update job config.xml files
start up Jenkins
There are other possible workflows like the following
1. update job config.xml files
2. reload config
However, with the second option I don't know how it effects if a job is running while you reload a config.
The following script requires the Jenkins Groovy and Groovy postbuild plugins to work. It will add a Jenkins Groovy postbuild publisher to all jobs:
https://gist.github.com/genericpenguin/9ac1b84ed7a145b3b6dd
Change the view from 'All' to some other view for testing. We use it for mass changes and it works fine. Only caveat is that postbuild groovy script must reside on Jenkins master. This can be easily changed in the script if it is short (like a script loader).
What happens to a CruiseControl.NET project if a trigger fires to build the project while it's already building due to someone "Force" building it earlier?
Will the build request of the trigger got queued?
We use CCNET 1.5 and 1.6.
Nothing, while a build is running triggers are not executed. However if you configured a sourcecontrol block for example for svn or p4, modifications during forced build will still be detected and cause another build in consequence.
You can see easier this if you add <queueStatusServerPlugin /> to the serverPlugins in dashboard.config.
In CruiseControl.NET, I have two projects set up, one for building and one for deploying build packages.
Our build is largely based around MSBuild, and as it runs the dashboard constantly updates with the latest output from the build. This means that even though a full build may take 15 minutes, you can see exactly where it is, and that it's making progress.
The deploy is run using another tool (VisualBuild, though I'm see the same basic behaviour with other tools like PowerShell). This is another long-running task, but in this case the dashboard is not updated with its output as it progresses. Since a deploy may take a long time, it's hard to tell whether things are progressing or if things have stalled. The output is getting logged to the CruiseControl.NET log, and will display on the dashboard once things are done, but not while the deploy is in progress.
Is there a way to get output from other arbitrary long-running tasks updated on the dashboard in something resembling real time? What makes MSBuild special in this regard?
CruiseControl.Net, since version 1.4, includes support for build listener files: it's a mechanism which allows tracking the execution of long-running tasks by reading from a log file. While this mechanism is generic, and can be used with any tool, CruiseControl.Net by itself ships only with build listeners for MSBuild and NAnt (which means that for those two tools progress is reported automatically, without the need for extra configuration).
For an external tool, such as VisualBuild, called by <exec> task, you would have to plug in your own logger that creates a simple progress file:
<data>
<Item Time="2007-10-14 08:43:12" Data="Starting Build timetester" />
<Item Time="2007-10-14 08:43:16" Data="Starting Target build" />
<Item Time="2007-10-14 08:43:16" Data="Sleeping for 5000 milliseconds." />
</data>
in the location pointed to by the CCNetListenerFile environment variable.