使用CC .NET进行分叉处理

Zia*_*hoy 5 cruisecontrol.net

有没有办法在Cruise Control .NET中分叉进程?我希望CC .NET在完成所有工作后启动程序,但是现在,CC .NET坚持等待程序关闭,然后再说构建完成.

启动的程序一次最多可运行数周.

Ale*_*lex 5

我这样做的方法是使用PowerShell或Batch脚本.该脚本可以启动您的进程,并在生成可执行文件后正常返回给CC.NET.这是我能看到的唯一方法,因为CC.NET确实需要知道它返回并且脚本可以返回,即使你生成的进程仍在运行.一个示例PowerShell脚本,可以执行您想要的操作.然后,您只需使用exe的路径作为参数调用powershell脚本.

    param(  [string] $exePath = $(throw "A path to executable required.")
    )

Invoke-Item $exePath
Run Code Online (Sandbox Code Playgroud)

这里在CC.NET 1.5上将是如何设置powershell任务

<powershell> 
    <script>yourScriptName.ps1</script> 
    <scriptsDirectory>D:\CruiseControl</scriptsDirectory> 
    <buildArgs>full path to exe you want to kick-off</buildArgs>     
</powershell>
Run Code Online (Sandbox Code Playgroud)