在CruiseControl.NET上运行gulp任务

有没有人有任何经验CruiseControl上运行吞咽? 我们有一些麻烦,通过XMLconfiguration文件自动化的过程。 可以通过本地和虚拟机上的CommandPrompt手动启动任务,但是从CruiseControl启动时出现错误:

ThoughtWorks.CruiseControl.Core.Tasks.BuilderException: Unable to execute: gulp TaskName System.IO.IOException: Unable to execute file [D:\CC.NET\VSS\%CorrectPathName%\gulp]. The file may not exist or may not be executable. 

任何帮助深表感谢。

更新在尝试了Simon Laing所build议的之后,开始出现另一个错误:

  <buildresults> <message level="Error">module.js:327</message> <message level="Error"> throw err;</message> <message level="Error"> ^</message> <message level="Error">Error: Cannot find module 'D:\CC.NET\VSS\Path\to\the\project\gulp'</message> <message level="Error"> at Function.Module._resolveFilename (module.js:325:15)</message> <message level="Error"> at Function.Module._load (module.js:276:25) </message> <message level="Error"> at Function.Module.runMain (module.js:441:10) </message> <message level="Error"> at startup (node.js:139:18)</message> <message level="Error"> at node.js:968:3</message> </buildresults> </build> </cruisecontrol> 

PATH被设置为:%APPDATA%\ npm,通过安装gulp

 npm install gulp -g 

 npm install gulp --save-dev 

在我看来,configuration启动节点,正在寻找一个错误的地方吞咽。

Gulp通常通过gulp-cli从命令行执行,不需要用gulp参数执行node

要解决你的问题,你需要告诉巡航控制哪个可执行文件(node.exe)运行哪个工具,它的参数。

你的情况应该是:

  • 文件名: Path\to\node.exe
  • 参数: gulp <any-other-switches>

替代解决scheme ,让cmd执行你的节点:

  • 文件名: c:\windows\system32\cmd.exe
  • 参数: /c gulp <any-other-switches>

cmd然后可以读取path并执行注释,因为gulp-cli可以控制是否手动调用它。

迟到的答案,我知道,但是,即使在上面接受的答案中尝试了方法之后,我仍然有同样的问题。

在我的情况下,我使用“au build”构buildaurelia应用程序,需要find并运行节点。 无论我尝试了多less次,我都无法让CCNet看到path,所以我在该任务中添加了一个“Environment”块,并将我的系统path目录复制到其中。

一旦我做到了,一切都很快乐。

作为参考,这是我的CCNet.config文件中的exec任务现在看起来像。

 <cruisecontrol xmlns:cb="urn:ccnet.config.builder"> <project name="blahproject"> <sourcecontrol type="git"> ... </sourcecontrol> <triggers> ... </triggers> <tasks> <exec> <executable>C:\windows\system32\cmd.exe</executable> <baseDirectory>C:\myproject\working\folder</baseDirectory> <buildArgs>/c au build</buildArgs> <buildTimeoutSeconds>60</buildTimeoutSeconds> <successExitCodes>0</successExitCodes> <environment> <variable> <name>path</name> <value>C:\Users\Administrator\AppData\Roaming\npm;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Program Files\nodejs\</value> </variable> </environment> </exec> <msbuild> ... </msbuild> </tasks> </project> </cruisecontrol> 

正如您所看到的,环境设置path,以便可以find我的所有工具,同时使用基本目录标记有效地设置您的项目文件所在的工作目录。

    Interesting Posts