Jenkins管道 - 没有这样的DSL方法' build'

时间:2017-02-08 16:32:17

标签: jenkins groovy jenkins-pipeline

我在Jenkins Pipeline中使用Groovy Script下面来调用自由风格的作业,但最终结果是"没有这样的DSL方法' build'"错误。

node{
       def branches = [:] 
       List rows =["Test2", "Test1"] 
       for (int i = 0; i <rows.size(); i++) 
       { 
         def index = i  
         String db = rows[i] 
         branches["branch${i}"] = { 
             build job: 'CopyFile', parameters: [[$class:  
            'StringParameterValue', name:  'DatabaseName', value: db], [$class: 
            'StringParameterValue', name:'dummy', value: "${index}"]] 
       } 
   } 
   parallel branches
}   

1 个答案:

答案 0 :(得分:3)

安装“Pipeline Build Step Plugin”解决了这个问题

https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Build+Step+Plugin