Re: HELP!!! if/else condition with cruise control???

Glenn Boysko <[email protected]> Fri, 14 Sep 2012 09:29:45 -0400
Newsgroups gmane.comp.java.cruise-control.user
Message-ID <83BDAC2C1FD82D4F80A40EA9ACB9DCA53D6055117A@VMBX134.ihostexchange.net>
I use this approach as well. One thing to keep in mind is that when you do change the underlying file (EmailPublisher.xml, in this case), it will not automatically affect CruiseControl. I have to stop and restart CC to affect the change.

I believe that this is due to the fact that this form of XML inclusion copies the content into the config.xml (at runtime) and no longer refers to the file on disk. 

-----Original Message-----
From: aligisan [mailto:[email protected]] 
Sent: Friday, September 14, 2012 8:58 AM
To: [email protected]
Subject: Re: [Cruisecontrol-user] HELP!!! if/else condition with cruise control???


Good, i didn't know this one! So, in order to achieve what i want, i pre-define some plugins that i overwrite then with some custom blocks, replacing also repetitive blocks by embeded xml files.
Thanx for sharing!



SMurph wrote:
> 
> To avoid duplication in my CruiseControl configuration I use XML 
> entity references.
> 
> Put the publisher into an external xml file, then at the top of your 
> config file you reference the external file, giving the relative path 
> to the config.xml file.
> 
> <!DOCTYPE cruisecontrol [
> <!ENTITY EmailPublisher SYSTEM 
> "./CruiseConfig/common/EmailPublisher.xml">
> ]>
> 
> <cruisecontrol>
> .
> .
> 
> Then when you want to use the publisher you reference it by doing the 
> following
> 
>         &EmailPublisher;
> 
> Regards,
> Steve
> 
> -----Original Message-----
> From: aligisan
> Sent: 11 September 2012 14:16
> To: [email protected]
> Subject: Re: [Cruisecontrol-user] HELP!!! if/else condition with 
> cruise control???
> 
> 
> Thanx, I was also thinking about it, but i want to keep the template
> (plugin)
> as generic as possible, avoiding BTW unnecessary "copy-paste". In this 
> example it would mean to copy the whole <publisher> block...
> 
> 
> SMurph wrote:
>>
>> Hi there,
>>
>> I don't think you can do anything like that.  Could you not just 
>> override the property?
>>
>> Your default value is set as a global property at the 'top' level in 
>> the CruiseControl configuration file, then in any project where you 
>> want to use a different value you just set the property again.
>>
>> Regards,
>> Steve
>>
>>
>> -----Original Message-----
>> From: aligisan
>> Sent: 11 September 2012 10:05
>> To: [email protected]
>> Subject: [Cruisecontrol-user] HELP!!! if/else condition with cruise 
>> control???
>>
>>
>> how can i insert some if/else conditions with cruise control???
>> let's assume i have defined a "project" plugin, i want to insert an 
>> "if/else" condition depending on parameter values... something like this:
>>
>> <plugin name="MyProject"
>> classname="net.sourceforge.cruisecontrol.ProjectConfig">
>> ....
>> ....
>> <publishers>
>>             <htmlemail>
>>                 if (${parameter.alwaysAdress} != "")
>>                     <always  address="${parameter.alwaysAdress}"/>
>>                 else
>>                     <always  address="[email protected]"/>
>>     </htmlemail>
>> </publishers>
>> ....
>> ....
>>
>> </plugin>
>>
>> <MyProject name="myProject_x64_release" buildafterfailed="false" > 
>> <property name="parameter.alwaysAdress" value="[email protected]"/> 
>> </MyProject>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/HELP%21%21%21-if-else-condition-with-cruise-con
>> trol----tp34417277p34417277.html Sent from the CruiseControl - User 
>> mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> ---------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and 
>> threat landscape has changed and how IT managers can respond. 
>> Discussions will include endpoint security, mobile security and the 
>> latest in malware threats. 
>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Cruisecontrol-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
>>
>>
>> ---------------------------------------------------------------------
>> ---------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and 
>> threat landscape has changed and how IT managers can respond. 
>> Discussions will include endpoint security, mobile security and the 
>> latest in malware threats. 
>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Cruisecontrol-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
>>
>>
> 
> --
> View this message in context: 
> http://old.nabble.com/HELP%21%21%21-if-else-condition-with-cruise-cont
> rol----tp34417277p34418269.html Sent from the CruiseControl - User 
> mailing list archive at Nabble.com.
> 
> 
> ----------------------------------------------------------------------
> --------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. 
> Discussions will include endpoint security, mobile security and the 
> latest in malware threats. 
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Cruisecontrol-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
> 
> 
> ----------------------------------------------------------------------
> --------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. 
> Discussions will include endpoint security, mobile security and the 
> latest in malware threats. 
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Cruisecontrol-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
> 
> 

--
View this message in context: http://old.nabble.com/HELP%21%21%21-if-else-condition-with-cruise-control----tp34417277p34432789.html
Sent from the CruiseControl - User mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Cruisecontrol-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html