CCNet 1.6 Conditional Plugin Help Needed! - cruisecontrol.net

I cannot get the conditional plugin to work that has been added to CCNet as of version 1.6 - clicky. I am running the latest version of CCNet (1.6.7258.1) and have the following code in my ccnet.config:
<project name="9iCompile">
<sourcecontrol type="svn">
<trunkUrl>http://bis-build:81/svn/Oracle/oas_forms/COPEN</trunkUrl>
<workingDirectory>C:\OAS\COPEN</workingDirectory>
<username>*</username>
<password>*</password>
<executable>C:\Program Files\VisualSVN\bin\svn.exe</executable>
</sourcecontrol>
<conditional>
<conditions>
<compareCondition>
<value1>$[ProjectType]</value1>
<value2>copen</value2>
<evaluation>equal</evaluation>
<ignoreCase>true</ignoreCase>
</compareCondition>
</conditions>
<tasks>
<nant>
<executable>C:\Program Files\nant-0.85\bin\nant.exe</executable>
<baseDirectory>C:\OAS</baseDirectory>
<buildFile>Oracle9i_Automation_v2.build</buildFile>
<targetList>
<target>build</target>
</targetList>
</nant>
</tasks>
</conditional>
<!-- more conditional statements would be here for different project types if I can get it to work -->
<parameters>
<selectParameter name="ProjectType">
<description>The type of project to operate on.</description>
<allowedValues>
<value name="COPEN">copen</value>
<value name="BCS">bcs</value>
<value name="FCDD">fcdd</value>
</allowedValues>
</selectParameter>
</parameters>
<security type="defaultProjectSecurity" defaultRight="Deny">
<permissions>
<rolePermission name="Developers" ref="Developers"/>
<rolePermission name="Accepters" ref="Accepters"/>
<rolePermission name="Releasers" ref="Releasers"/>
<rolePermission name="Administrators" ref="Administrators"/>
</permissions>
</security>
</project>
The CCNet server crashes whenever I try to run this config though with
the following output:
[14:ERROR] Exception: Unused node detected:
<conditional>
<conditions>
<compareCondition>
<value1>$[ProjectType]</value1>
<value2>copen</value2>
<evaluation>equal</evaluation>
<ignoreCase>true</ignoreCase>
</compareCondition>
</conditions>
<tasks>
<nant>
<executable>C:\Program Files\nant-0.85\bin\nant.exe</executable>
<baseDirectory>C:\OAS</baseDirectory>
<buildFile>Oracle9i_Automation_v2.build</buildFile>
<targetList>
<target>build</target>
</targetList>
</nant>
</tasks>
</conditional>
----------
ThoughtWorks.CruiseControl.Core.Config.ConfigurationException: Unused
node detected:
<conditional>
<conditions>
<compareCondition>
<value1>$[ProjectType]</value1>
<value2>copen</value2>
<evaluation>equal</evaluation>
<ignoreCase>true</ignoreCase>
</compareCondition>
</conditions>
<tasks>
<nant>
<executable>C:\Program Files\nant-0.85\bin\nant.exe</executable>
<baseDirectory>C:\OAS</baseDirectory>
<buildFile>Oracle9i_Automation_v2.build</buildFile>
<targetList>
<target>build</target>
</targetList>
</nant>
</tasks>
</conditional>
at ThoughtWorks.CruiseControl.Core.Config.NetReflectorConfigurationReader.Defa­ultErrorProcesser.ProcessError(String message)
at ThoughtWorks.CruiseControl.Core.Config.NetReflectorConfigurationReader.<>c_­_DisplayClass1.<Read>b__0(InvalidNodeEventArgs args)
at Exortech.NetReflector.InvalidNodeEventHandler.Invoke(InvalidNodeEventArgsar­gs)
at Exortech.NetReflector.NetReflectorTypeTable.OnInvalidNode(InvalidNodeEventA­rgs args)
at Exortech.NetReflector.XmlTypeSerialiser.HandleUnusedNode(NetReflectorTypeTa­ble table, XmlNode orphan)
at Exortech.NetReflector.XmlTypeSerialiser.ReadMembers(XmlNode node, Object instance, NetReflectorTypeTable table)
at Exortech.NetReflector.XmlTypeSerialiser.Read(XmlNode node, NetReflectorTypeTable table)
at Exortech.NetReflector.NetReflectorReader.Read(XmlNode node)
at ThoughtWorks.CruiseControl.Core.Config.NetReflectorConfigurationReader.Read­(XmlDocument document, IConfigurationErrorProcesser errorProcesser)
at ThoughtWorks.CruiseControl.Core.Config.DefaultConfigurationFileLoader.Load(­FileInfo configFile)
at ThoughtWorks.CruiseControl.Core.Config.FileConfigurationService.Load()
at ThoughtWorks.CruiseControl.Core.Config.FileWatcherConfigurationService.Load­()
at ThoughtWorks.CruiseControl.Core.Config.CachingConfigurationService.Load()
at ThoughtWorks.CruiseControl.Core.CruiseServer.Restart()
at ThoughtWorks.CruiseControl.Core.Config.ConfigurationUpdateHandler.Invoke()
at ThoughtWorks.CruiseControl.Core.Config.FileWatcherConfigurationService.Hand­leConfigurationFileChanged(Object source, FileSystemEventArgs args)
----------
Can someone please help?? I have no idea what I'm doing wrong here or
if this is a bug :( I have also posted on the ccnet-user group several days ago but have not received any response :(

I have received a response from the ccnet-user group now. The conditional block is in fact a task type so needs to be in a tasks or publishers element.

Related

Error with WCF webservice moved to Azure VM

I have an old WCF webservice that's been moved to Azure VM.
I can easily access in Azure:
https://wcf/service.svc,
but when I try to post to:
https://wcf/service.svc/json/DoAction
it comes back with an empty response, when I open this in the browser I get 404 error.
Outside of Azure it all works fine, any ideas what can I do to get it to work? I would like to keep it running in VM as there are other items that were moved and work fine.
Here is the part of the web.config file that relates to "/json/" part:
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="Service123" behaviorConfiguration="ChallengeBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="ChallengeMessageEncoding" contract="IService123" behaviorConfiguration="SoapServiceBehavior" />
<endpoint address="/json" binding="webHttpBinding" bindingConfiguration="RestServiceMessageEncoding" contract="IService123" behaviorConfiguration="RestServiceBehavior" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="RestServiceBehavior">
<webHttp defaultOutgoingResponseFormat="Json" automaticFormatSelectionEnabled="true" />
</behavior>
<behavior name="SoapServiceBehavior">
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="RestServiceMessageEncoding">
<security mode="None">
</security>
</binding>
</webHttpBinding>
<wsHttpBinding>
<binding name="ChallengeMessageEncoding">
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" />
<message clientCredentialType="None" establishSecurityContext="false" negotiateServiceCredential="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
There is no problem the code snippets seem to me. Which version IIS is installed in the Azure VM? Do you have enabled the feature supported for WCF in IIS.
I suspect that the WCF service published on the VM does not work properly. Try to publish a default WCF service application project and browse the self-introduction page.
In addition, for a specific port, you need to enable outbound/inbound permission on the firewall.
VM>>Settings>>Network
Feel free to contact me if there is anything I can help with.
#Abraham, thank you for your answer.
I finally got it working, not sure which part helped but changes I introduced included:
a) Installed additional WCF features (as above) as only 2 were installed
b) Added extra bits to web config (allowing to run URLs with dots in name /Foo.svc/Save )
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<clear />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="/*" verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
c) Another config to support dots:
<modules runAllManagedModulesForAllRequests="true" />
d) Extended endpoints to support HTTPS as the above started working for HTTP:
<service name="PrivateService" behaviorConfiguration="PrivateBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="PrivateBehavior" contract="IPrivateService" behaviorConfiguration="SoapBehavior" />
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="PrivateBehaviorSecure" contract="IPrivateService" behaviorConfiguration="SoapBehavior" />
<endpoint address="/json" binding="webHttpBinding" bindingConfiguration="RestSecure" contract="IPrivateServices" behaviorConfiguration="RestBehavior" />
<endpoint address="/json" binding="webHttpBinding" bindingConfiguration="Rest" contract="IPrivateService" behaviorConfiguration="RestBehavior" />
</service>
...
<webHttpBinding>
<binding name="Rest">
<security mode="None">
</security>
</binding>
<binding name="RestSecure">
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" />
</security>
</binding>
</webHttpBinding>

Could not install windows feature IIS

I tried to reinstall iis on my windows 10 system through Control Panel\Programs and Features\ Turn Windows features on or off but after uninstalling it there is a problem with installing iis again.
Here are screenshots with all errors I'm facing at the moment:
In folder Windows/System32/inetsrv/config I recreated file named ApplicationHost.config
here is the configuration:
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<system.applicationHost>
<applicationPools>
<add name="DefaultAppPool" />
<applicationPoolDefaults>
<processModel identityType="NetworkService" />
</applicationPoolDefaults>
</applicationPools>
<customMetadata />
<listenerAdapters>
<add name="http" />
</listenerAdapters>
<log>
<centralBinaryLogFile enabled="true" directory="%SystemDrive%\inetpub\logs\LogFiles" />
<centralW3CLogFile enabled="true" directory="%SystemDrive%\inetpub\logs\LogFiles" />
</log>
<sites>
<site name="Default Web Site" id="1">
<application path="/">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%SystemDrive%\inetpub\logs\LogFiles" />
<traceFailedRequestsLogging directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles" />
</siteDefaults>
<applicationDefaults applicationPool="DefaultAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
<webLimits />
</system.applicationHost>
</configuration>
Does anyone had something like that before me and was able to run IIS again without reinstalling entire system from scratch?
If any information needed please do not hasitate to ask in comment section.
Thanks in advance :)
Thanks to #LexLi and links provided by him i was able to find out what caused the issue.
Main Link
Second one
And last which point the way to uninstall Windows Process Activation Service in Windows 10 pro not server one
Just to be sure I uninstalled:
Internet Information Services Hostable Web Core
I hope this answer would help someone in future.
Thanks again #LexLi for assistant.
Cheers!

CCNET Config Conditional Task Execution

Hi all require help on CCNet Conditional execution.
These are the Triggers I have declared
<intervalTrigger
name="continuous"
seconds="30"
buildCondition="IfModificationExists"
initialSeconds="5"/>
<scheduleTrigger time="23:30" buildCondition="ForceBuild" name="scheduled">
<weekDays>
<weekDay>Monday</weekDay>
</weekDays>
</scheduleTrigger>
</triggers>
Below is the Task I am Having both to be triggered based on Condition
<conditional>
<conditions>
<compareCondition value1="$[buildCondition]"
value2="IfModificationExists" />
</conditions>
<tasks>
<msbuild >
<executable>...\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>...\WcfServiceLibrary1\</workingDirectory>
<projectFile>MSBuild_MasterConfigFile.BUILD</projectFile>
<buildArgs>/target:CCNETBUILD /p:Config=Debug</buildArgs>
<timeout>900</timeout>
</msbuild>
<elseTasks>
<msbuild ><executable>...\v4.0.30319\MSBuild.exe</executable>
<workingDirectory>...\WcfServiceLibrary1\</workingDirectory>
<projectFile>MSBuild_MasterConfigFile.BUILD</projectFile>
<buildArgs>/target:CCNETDeploy /p:Config=Debug</buildArgs>
<timeout>900</timeout>
</msbuild>
</elseTasks>
</conditional>
I am getting unused node detected exception. Please help me asap. Thanks in advance.
It is difficult to tell from your code sample, but did you check that the <Conditionals> node is embedded within a <tasks>...</tasks> node in your project declaration?
In other words:
<project>
<tasks>
<conditional>...</conditional>
</tasks>
</project>
and not
<project>
<conditional>...</conditional>
</project>

Not able to see the FxCop Report embeded in the Email using CruiseControl.Net

I have installed Cruise Control 1.5 on my machine and trying to configure the automated build. Everything is working fine. Application is building, i receive an email but I don't see the FXCop result embedded in the Build Email. What am i missing?
ccnet.config file
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<project name="SampleProject">
<webURL>http://localhost/ccnet</webURL>
<workingDirectory>E:\\NewProject\\DevBuilds</workingDirectory>
<artifactDirectory>E:\\NewProject\\DevBuilds\Artifacts</artifactDirectory>
<modificationDelaySeconds>600</modificationDelaySeconds>
<category>Dev Build</category>
<sourcecontrol type="svn">
<trunkUrl>https://mycompany.com/svn/trunk/MyApplication</trunkUrl>
<workingDirectory>E:\\NewProject\\DevBuilds\SourceCode</workingDirectory>
<autoGetSource>false</autoGetSource>
<executable>C:\Program Files\Subversion\bin\svn.exe</executable>
<username>username</username>
<password>password</password>
</sourcecontrol>
<initialState>Started</initialState>
<startupMode>UseInitialState</startupMode>
<triggers>
<intervalTrigger seconds="3600" buildCondition="IfModificationExists" />
</triggers>
<state type="state" directory="E:\\NewProject\\DevBuilds" />
<labeller type="iterationlabeller">
<prefix>1.0</prefix>
<duration>1</duration>
<releaseStartDate>2012/04/11</releaseStartDate>
<separator>.</separator>
</labeller>
<tasks>
<nant>
<executable>E:\NewProject\Installables\nant\bin\nant.exe</executable>
<baseDirectory>E:\\NewProject\\Build Files</baseDirectory>
<buildFile>Build.xml</buildFile>
<targetList>
<target>Run</target>
</targetList>
<buildTimeoutSeconds>5000</buildTimeoutSeconds>
</nant>
</tasks>
<publishers>
<merge>
<files>
<file>E:\NewProject\DevBuilds\FxCopOutput\FxCop-results.xml</file>
</files>
</merge>
<xmllogger logDir="E:\\NewProject\\DevBuilds\Artifacts\\buildlogs" />
<email from="Checkins#symphonysv.com" mailhost="smtp.gmail.com" includeDetails="true" useSSL="false">
<users>
<user name="dev1" group="buildmaster" address="myname#gmail.com"/>
</users>
<groups>
<group name="buildmaster">
<notifications>
<notificationType>Always</notificationType>
</notifications>
</group>
</groups>
</email>
</publishers>
</project>
</cruisecontrol>
Build.xml
<?xml version="1.0"?>
<project name="Test" default="Run" basedir=".">
<property name="BuildNumber" value="1.0.0.0"/>
<property name="SourceControlURL" value="https://mycompany.com/svn/trunk/MyApplication/"/>
<property name="BuildFile" value=".\Build.xml"/>
<property name="TagBuild" value="false"/>
<property name="BuildType" value="Release"/>
<property name="BuildTargetDir" value="E:\NewProject\DevBuilds\Executables"/>
<property name="BuildWorkDir" value="E:\NewProject\DevBuilds\SourceCode"/>
<property name="MSBUILD" value="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319"/>
<property name="FxCopOutPutDirectory" value="E:\NewProject\DevBuilds\FxCopOutput" />
<property name="FxCopInputDirectory" value="E:\NewProject\DevBuilds" />
<target name="Run" description="Starting ThinkPets Build">
<call target="GetLatestCode"/>
<call target="BuildCode"/>
<call target="BuildASPWebSite"/>
<call target="runFxCop"/>
</target>
<target name="GetLatestCode">
<echo message="Updating Code From SVN to ${BuildWorkDir}"/>
<exec program="svn.exe">
<arg line="checkout ${SourceControlURL} ${BuildWorkDir} -q"/>
</exec>
</target>
<target name="BuildCode">
<echo message="Building VS10 Projects Web" />
<exec program="${MSBUILD}\msbuild.exe" failonerror="true">
<arg line=" "${BuildWorkDir}\Application.sln" /t:Rebuild /p:Configuration=Release /V:q"/>
</exec>
</target>
<target name="BuildASPWebSite">
<echo message="Building ASP Web Site" />
<exec program="${MSBUILD}\aspnet_compiler.exe" failonerror="true">
<arg line=" -v / -p "${BuildWorkDir}\MyDir" -f -c "${BuildTargetDir}" "/>
</exec>
</target>
<target name="runFxCop" depends="BuildCode">
<exec program="C:\Program Files\Microsoft FxCop 1.36\FxCopCmd.exe" failonerror="false">
<arg line="/p:${FxCopInputDirectory}\SampleProject.FxCop /o:${FxCopOutPutDirectory}\FxCop-results.xml"/>
</exec>
</target>
</project>
There are a few points you missed:
You need to add <includeDetails>true</includeDetails> to your e-mail publisher block. This will give you HTML e-mails.
In order to transform your XML build results into HTML you need to add an <xslFiles> section to your e-mail publisher block. The elements of this block point to XSL transformation files in [CCNET_INSTALL_DIR]\server\xsl.
So for including the FxCop summary just as appears in CCNET webdasboard this is your e-mail publisher block:
<email from="Checkins#symphonysv.com" mailhost="smtp.gmail.com" includeDetails="true" useSSL="false">
<users>
<user name="dev1" group="buildmaster" address="myname#gmail.com"/>
</users>
<groups>
<group name="buildmaster">
<notifications>
<notificationType>Always</notificationType>
</notifications>
</group>
</groups>
<includeDetails>true</includeDetails>
<xslFiles>
<file>xsl\fxcop-summary_1_36.xsl</file>
</xslFiles>
</email>
Thanks Chairman for your valuable time. I think my mistake was that I did not host the "ccnet" application on my machine which resulted in not able to find the xsls for the publishers. When I used the same settings and config file on the Server machine with "ccnet" application hosted, I was able to see the FxCop summary in the email. Please correct my understanding if wrong.

issues in cc.net (cruisecontrol.net) with uppercut

I have installed uppercut integrated cc.net such a way that i didnt make any change in webdashboard,
This is my cc.net config code,
-->
-->
<!-- PROJECT STRUCTURE -->
<cb:define name="WindowsFormsApplication1">
<project name="$(projectName)">
<workingDirectory>$(working_directory)\$(projectName)</workingDirectory>
<artifactDirectory>$(drop_directory)\$(projectName)</artifactDirectory>
<category>$(projectName)</category>
<queuePriority>$(queuePriority)</queuePriority>
<triggers>
<intervalTrigger name="continuous" seconds="60" buildCondition="IfModificationExists" />
</triggers>
<sourcecontrol type="svn">
<executable>c:\program files\subversion\bin\svn.exe</executable>
<!--<trunkUrl>http://192.168.1.8/trainingrepos/deepasundari/WindowsFormsApplication1</trunkUrl>-->
<trunkUrl>$(svnPath)</trunkUrl>
<workingDirectory>$(working_directory)\$(projectName)</workingDirectory>
</sourcecontrol>
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>$(working_directory)\$(projectName)</workingDirectory>
<projectFile>WindowsFormsApplication1.sln</projectFile>
<timeout>600</timeout>
<buildArgs> /noconsolelogger /p:configuration=Debug </buildArgs>
<!--<buildArgs>/noconsolelogger /p:OutputPath=$(drop_directory)\$(projectName)\sample </buildArgs>-->
<logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
<!--<labeller type="svnRevisionLabeller">
<prefix>Test-</prefix>
<major>7</major>
<minor>11</minor>
<url>$svnpath</url>
<username>deepasundari</username>
<password>deepasundari</password>
</labeller>-->
<exec>
<executable>$(working_directory)\$(projectName)\build.bat</executable>
</exec>
</tasks>
<publishers>
<!--<buildpublisher>
--><!--<sourceDir>C:\myprojects\project1</sourceDir>--><!--
<publishDir>$(working_directory)\$(projectName)</publishDir>
</buildpublisher>-->
<merge>
<files>
<file>$(working_directory)\$(projectName)\build_output\build_artifacts\*.xml</file>
<file>$(working_directory)\$(projectName)\build_output\build_artifacts\mbunit\*-results.xml</file>
<file>$(working_directory)\$(projectName)\build_output\build_artifacts\nunit\*-results.xml</file>
<file>$(working_directory)\$(projectName)\build_output\build_artifacts\ncover\*-results.xml</file>
<file>$(working_directory)\$(projectName)\build_output\build_artifacts\ndepend\*.xml</file>
</files>
</merge>
<!--<email from="buildserver#somewhere.com" mailhost="smtp.somewhere.com" includeDetails="TRUE">
<users>
<user name="YOUR NAME" group="BuildNotice" address="yourEmail#somewhere.com" />
</users>
<groups>
<group name="BuildNotice" notification="change" />
</groups>
</email>-->
<xmllogger/>
<statistics>
<statisticList>
<firstMatch name="Svn Revision" xpath="//modifications/modification/changeNumber" />
<firstMatch name="ILInstructions" xpath="//ApplicationMetrics/#NILInstruction" />
<firstMatch name="LinesOfCode" xpath="//ApplicationMetrics/#NbLinesOfCode" />
<firstMatch name="LinesOfComment" xpath="//ApplicationMetrics/#NbLinesOfComment" />
</statisticList>
</statistics>
<modificationHistory onlyLogWhenChangesFound="true" />
<rss/>
</publishers>
</project>
</cb:define>
<cb:WindowsFormsApplication1 projectname="WindowsFormsApplication1" queuepriority="1" svnpath="http://192.168.1.8/trainingrepos/deepasundari/WindowsFormsApplication1" />
this code is updating rss and report xml files, but i could not get the build folder in the code_drop..
could anyone help me with this problem??
It looks like you have followed the sample almost perfectly. http://uppercut.googlecode.com/svn/trunk/docs/Samples/CC.NET/server/ccnet.config
What you should see in the code_drop folder on the build server is a folder b##-r## for build and revision per each build.
Most of this is talked about in here: http://uppercut.googlecode.com/svn/trunk/docs/IntegrateUppercuTWithCruiseControl.NET.doc

Resources