I have a trigger scheduled in my Build config file. It used to work before but I noticed that it's not working since the past few days. Can anyone give a suggestion on this? Where should I check for this? This is my trigger.
<triggers>
<scheduleTrigger time="21:30" buildCondition="ForceBuild" name="Scheduled"></scheduleTrigger>
</triggers>
It is probably because the cruise control project is stopped. If it is stopped the Schedule Trigger would not work, but the intervalTrigger will.
you can add a trigger to force the build on determined time like this.
<triggers>
<intervalTrigger name="Schedule" seconds="1800" />
</triggers>
here it will force on every 30 minutes
As per your condition , IFModification exists , then only the build will be triggered it is not explicit ,better have this done this way else it is unnesary to havea build done without any code change
Related
I have two build projects. lets call them project A and project A.pack. When I force build project A it asks me for Boolean parameter if I want to build project A.pack.
But I can't make in publishers block of project A a correct way to force build the project A.pack. I use conditional task but it doesn't work. In log file ccnet writes only that it fails on conditional task. What a usual way to do this in ccnet?
Update:
Sorry for my English. It's not my first language.
What I wanted to do is this:
In project A I added Boolean parameter:
<booleanParameter>
<name>ExampleParam</name>
<true name="Yes">1</true>
<false name="No">0</false>
<display>Example Param</display>
<default>No</default>
<required>false</required>
</booleanParameter>
And added conditional forcebuild in publishers like this:
<publishers>
<!-- some other tasks .. -->
<conditional>
<conditions>
<compareCondition>
<value1>${ExampleParam}</value1>
<value2>1</value2>
<evaluation>equal</evaluation>
</compareCondition>
</conditions>
<tasks>
<forcebuild>
<project>A.pack</project>
<serverUri>tcp://localhost:21235/CruiseManager.rem</serverUri>
</forcebuild>
</tasks>
</conditional>
</publishers>
When I press "force" it asks me for "Example Param", I check "Yes" and when it finishes building dashboard says that build was succesful but ForceBuildPublisher task failed.
There is no information in server log about why force build task failed.
It's CruiseControl.NET-1.6.7
Update 20150808:
I convinced my colleagues to update CCnet. In version 1.8.5 it's possible to do a conditional build like I wrote.
If the boolean parameter is true then write to a file that A.pack watches. A.pack builds if the file gets dirty. See Filesystem Source Control Block for use by A.pack in listening to the file made dirty by A.
Okay.. I've been searching this specific question, and did find some examples, but not exactly the answer I wanted. Any thoughts, inputs would be greatly appreciated!
Situation I have is..
I have a daily build process via CCNet. They all have a buildCondition="ifModificationExists" parameter when building. This allows the CCNet to build if and only if there are modifications (checking the source "Update").
Problem is, I added a version Commit process at the very last part of each builds. Meaning, if I were to build 1.0.0.3, I'd Commit the changed AssemblyInfo.cs files (that contains the updated version number), and allows me to check the logs when each of the versions were built.
This completely screwed up the entire automated daily build process.. You see, because it commits the version every build whether or not it has any other Updates, the CCNet considers there's ALWAYS a modification before building each morning. Fact is, the only modification there has been was the version update from last build.
I cant think of a way to get around this, by keeping the version update + daily automate build when modifications exists.
Any help? :)
edit 1. here's the Triggers part for each of my build:
<!--TRIGGERS -->
<triggers>
<scheduleTrigger time="04:00" buildCondition="IfModificationExists" name="Scheduled">
</scheduleTrigger>
</triggers>
edit 2. and here's the part where I commit the files (AssemblyInfo.cs) using powershell
<powershell>
<script>commit.ps1</script>
<executable>C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe</executable>
<scriptsDirectory>D:\SRC\BuildTools</scriptsDirectory>
<buildArgs>D:\SRC\ProjectName\branches\3.0.3\</buildArgs>
<description>BuildCommit Dir D:\SRC\ProjectName\branches\3.0.3\src</description>
</powershell>
Thank you in advance,
I think you should be able to use filtered source control to do what you need:
http://cruisecontrolnet.org/projects/ccnet/wiki/Filtered
I have setup 2 projects in cc.net for the same web application. A continuous integration project that uses an interval trigger and works fine and a "nightly build" project that uses a cronTrigger. The nightly build essentially builds and deploys the staging/testing server so that people can test without being interrupted with a rebuild every time someone does a commit. What i want to do is have it auto build every morning at 6 am and allow force builds if you want to build any other time. THe cron expression I am using is 0 6 * * *, which i think is correct and seems to set the "next build time" correctly in cc.net. The problem I am encountering is that if i set the build condition to IfModificationExists then if there are no modifications since the last build, it doesn't build at the scheduled time, which is fine, but as soon as someone commits, it builds, which is not what i want, i want it to wait until the next scheduled time. So I tried setting the build condition to ForceBuild which i thought would just make it build at 6 AM every day regardless of whether there were any commits, but it doesn't it seems to make it build constantly over and over again. What am i missing doing wrong?
EDIT
Not sure if this really provides any more usefull info but further to a comment.
<triggers>
<cronTrigger>
<buildCondition>IfModificationExists</buildCondition>
<cronExpression>0 6 * * *</cronExpression>
</cronTrigger>
</triggers>
OR
<triggers>
<cronTrigger>
<buildCondition>ForceBuild</buildCondition>
<cronExpression>0 6 * * *</cronExpression>
</cronTrigger>
</triggers>
If you wants to run every day use
<scheduleTrigger time="06:00" buildCondition="ForceBuild" name="Scheduled"></scheduleTrigger>
Someone, knows how to solve this?? I have similar problem running once a month.
Taken from: http://build.sharpdevelop.net/ccnet/doc/CCNET/Cron%20Trigger.html
A single expression is composed of 5 space-delimited fields :
MINUTES HOURS DAYS MONTHS DAYS-OF-WEEK
Examples:
This trigger will execute 5th day of every month
<triggers>
<cronTrigger>
<cronExpression>0 0 5 * *</cronExpression>
</cronTrigger>
</triggers>
This trigger will execute every day at 5am
<triggers>
<cronTrigger>
<cronExpression>0 5 * * *</cronExpression>
</cronTrigger>
</triggers>
Regards,
Dejan
I'd like to do some action based on modified files. I have such project configuration
<project name="MyProject">
<sourcecontrol type="vsts" autoGetSource="true">
...
</sourcecontrol>
<tasks>
<msbuild>
...
</msbuild>
</tasks>
Is there any way how to put or access the modifications comes from source control in that configured MSBuild task? I cannot see any integration property for this, but I can see modifications in CCNET build log
<cruisecontrol project="MyProject">
<request source="ScheduledTrunk" buildCondition="ForceBuild">...</request>
<modifications>
<modification type="merge">
<filename>MyFile.cs</filename>
<project>$/MyProject/Trunk/Source/</project>
<date>2010-02-23 02:27:40</date>
<user>domain\user</user>
<comment>Some comment</comment>
<changeNumber>79367</changeNumber>
<version>79367</version>
</modification>
</modifications>
<integrationProperties>
...
</integrationProperties>
<build date="..." buildtime="..." buildcondition="...">
<msbuild
startTime="02/23/2010 11:55:52"
elapsedTime="00:00:51" success="true"
>
...
</msbuild>
</cruisecontrol>
Thanks for suggestion!
BTW do you know why the common CCNet documentation pages are down for several days already? And what is the primary discussion forum for CCNET?
You are looking for the Mofification Writer Task. This tasks writes modification details to an XML file, which can easily be evaluated from an MSBuild task.
I searched a lot but i didn't find a solution for my problem.
I use CruiseControl.NET (1.4.4). My project (in ccnet.config) load a repository from a cvs server to a local repository, and launch some executables (msbuild, NUnit...).
I use a trigger (Interval or Schedule Trigger), that launch regularly my project. But if my project has not been modified, it always launch all next tasks. And I would like to avoid it. So i want to launch my project only if a commit has been detected.
Is there any solution for it please?
Thanks
Olivier
Your trigger needs to specify IfModificationExists:
<intervalTrigger
name = "dave"
seconds = "30"
buildCondition = "IfModificationExists" />
Although buildCondition="IfModificationExists" is the default anyway, so as long as its not set to ForceBuild you should be fine.
EDIT:
The URL Trigger might be of some use to you. You can set your svn server to modify a page on commmit and the CC.Net checks the page to see if it has changed, thus not getting all the files.
I start my project as below, which ensures that the tasks get executed only if there are modifications.
Hope this helps,
Anders, Denmark
Edited: My code excerpt didn't make it to the page - I've tried to replace less-than, bigger-than with brackets.
[project name="SpilMerePool" queue="Q2" queuePriority="1"]
[sourcecontrol type="svn"]
[trunkUrl]https://ajf-ser1.ajf.local:8443/svn/SpilMerePool/trunk[/trunkUrl]
[workingDirectory]c:\from_vc\SpilMerePool[/workingDirectory]
[executable]C:\Program Files\VisualSVN Server\bin\svn.exe[/executable]
[username]username[/username]
[password]password[/password]
[/sourcecontrol]
Just use IntervalTrigger, like this:
<triggers>
<intervalTrigger />
</triggers>
You can also add an modificationDelaySeconds, to wait for a number of seconds before starting the build after the last commit.
<modificationDelaySeconds>30</modificationDelaySeconds>
Thank you Anders Juul abd Andy for your quick answers.
By using the intervalTrigger with "IfModificationExists" build condition, the project must be loaded each time (it's logical ^^). But my project size is about 450Mo. So it's a little long.
So my last question is : can we execute all builds and next tasks when a commit command has been detected? (without loading all files, in CruiseControl).
I use TortoiseCVS (version 1.10.10). Maybe we can force CruiseControl project to be lauched after a commit?