Is there any way to fork a process inside Cruise Control .NET? I want CC .NET to launch a program when everything's done but right now, CC .NET insists on waiting for the program to close before saying that the build is complete.
The program that is launched must run for up to weeks at a time.
The way I would do it is to use a PowerShell or Batch script. The script can launch your process and return back normally to CC.NET after spawning the executable. This is the only way I can see doing it, as CC.NET does need to know it returned and the script can return, even with the process you spawned still out there running. A sample PowerShell script that will do what you want. Then you just call the powershell script with the path to the exe as a paratemeter.
param( [string] $exePath = $(throw "A path to executable required.")
)
Invoke-Item $exePath
here on CC.NET 1.5 would be how to set up the powershell task
<powershell>
<script>yourScriptName.ps1</script>
<scriptsDirectory>D:\CruiseControl</scriptsDirectory>
<buildArgs>full path to exe you want to kick-off</buildArgs>
</powershell>
How about this... 2 Small programs
1) A process that runs all the time (maybe a windows service?), and listens on a tcp socket, when it gets a connection, execute your 3 week process.
2) A process that can be called by CC.NET, and opens a tcp connection to process #1, and then exits.
You could use any form of inter-process communication, but TCP sockets are easy and reliable.
Put the launch of the program into a separate CCNET project and add a ForceBuildPublisher to the original project.
<project name="OriginalProject">
<!-- ... -->
<publishers>
<!-- ... -->
<forcebuild>
<project>LaunchProgram</project>
</forcebuild>
</publishers>
</project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With