Concurrency Jenkins在并发grunt任务中崩溃

Concurrency Jenkins在并发grunt任务中崩溃,concurrency,jenkins,gruntjs,yeoman,Concurrency,Jenkins,Gruntjs,Yeoman,我试图在Jenkins中构建并运行一个基于grunt的构建任务,该任务是使用yeoman生成器创建的 詹金斯能够成功运行npm安装和bower安装 问题:当我运行gruntJenkins crashs时:无法通过浏览器访问它,它会丢失构建任务的条目,必须重新启动 如果我在任务运行时观察控制台输出,则在服务器崩溃之前收到的最后一条消息是: [4mRunning "concurrent:dist" (concurrent) task[24m [32m>> [39mWarning: The

我试图在Jenkins中构建并运行一个基于grunt的构建任务,该任务是使用yeoman生成器创建的

詹金斯能够成功运行
npm安装
bower安装

问题:当我运行
grunt
Jenkins crashs时:无法通过浏览器访问它,它会丢失构建任务的条目,必须重新启动

如果我在任务运行时观察控制台输出,则在服务器崩溃之前收到的最后一条消息是:

[4mRunning "concurrent:dist" (concurrent) task[24m [32m>>
[39mWarning: There are more tasks than your concurrency limit. After
this limit[32m
>> [39mis reached no further tasks will be run until the current tasksare[32m
>> [39mcompleted. You can adjust the limit in the concurrent task options
到目前为止我所尝试的:

// Run some tasks in parallel to speed up the build process
concurrent: {
  server: [
    'compass:server'
  ],
  test: [
    'compass'
  ],
  dist: [
    'compass:dist',
    'imagemin',
    'svgmin'
  ]
},
  • 我试图设置Jenkins以允许4个构建过程
  • 我还尝试将其限制为1个构建过程。两者都没有改变任何事情
  • 我不能真正改变grunt任务,因为我必须在30多个项目中完成它 问题:有没有一种方法可以在不崩溃的情况下运行并发grunt任务

    Grunfile.js的一部分:

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server'
      ],
      test: [
        'compass'
      ],
      dist: [
        'compass:dist',
        'imagemin',
        'svgmin'
      ]
    },
    

    您可以声明要使用的CPU核心数,即:

    options:
          limit: 2
          logConcurrentOutput: true
    

    虽然阿德本的回答是正确的,但他没有解释在哪里设置
    限制。它在您的GrunFile中,对于具有2个并发任务的示例,它应该这样看:

    grunt.initConfig({
        concurrent: {
            target: {
                tasks: [ 'watch', 'nodemon:run' ],
                options: {
                    limit: 2,
                    logConcurrentOutput: true
                }
            },
        }
    });
    

    这是

    的文档,我应该把这个限制放在哪里?在格伦特还是在詹金斯?