jenkins中的Grunt任务失败:Error Spawn Enoent?

时间:2015-09-16 13:44:56

标签: javascript jenkins gruntjs intern

我正在尝试使用grunt在Jenkins(奴隶)中构建我的实习生考试。 grunt文件执行某些功能,其中一个功能失败。我得到的错误是因为它无法启动示例。 jenkins控制台中的错误

[4mRunning "unzip:sample" (unzip) task[24m
Created "./sample" directory
[4mRunning "exec:start-sample" (exec) task[24m
[31m>> [39mFailed with: Error: spawn C:\Windows\system32\cmd.exe ENOENT
[33mWarning: Task "exec:start-sample" failed. Use --force to continue.[39m

这是没有错误的控制台

[4mRunning "unzip:sample" (unzip) task[24m
Created "./sample" directory
[4mRunning "exec:start-sample" (exec) task[24m
[4mRunning "wait:45" (wait) task[24m

GruntFile.js

module.exports = function(grunt) {
        grunt.initConfig({
            exec: {
                'start-sample': {
                   cmd: 'start serverstart.exe -z ../../sample',
                   cwd: '../../WEB-INF/bin64'
                },
                'stop-sample' : {
                    cmd: 'start serverstop.exe -n "Sample" -user abc -pwd abc',
                    cwd: '../../WEB-INF/bin64'
                }
            },
            unzip: {
                'sample' : {
                    src : '../../sample.zip',
                    dest : './sample'
                }
            }
        )};

        grunt.registerTask('run-tests', 'call tasks needed for test setup, testing, and teardown', 
            function(suite) {
               if (!suite) {
                   throw new Error('A suite name argument is required with the "it" task');
               }
               if(suite != 'unit'){
                   grunt.task.run([ 'get-sample', 'start-sample', 'wait:45']);
               }
       });

       grunt.registerTask('get-sample', "unzips the sample server", [ 'unzip-sample' ]);
       grunt.registerTask('start-sample', "starts sample server", [ 'exec:start-sample' ]);
       grunt.registerTask('stop-sample', "stops sample server", [ 'exec:stop-sample' ]);

       // By default we just test
       grunt.registerTask('default', [ 'run-tests:all' ]);

}

如何在jenkins中调试gruntfile?是什么导致样本服务无法启动?

0 个答案:

没有答案