詹金斯管道与并行命令

时间:2020-03-11 20:43:43

标签: jenkins continuous-integration jenkins-pipeline

我有这个基本的jenkis管道

注意:为了使代码更小,我省略了a = b.groupBy("year","month").agg((sum("dollar")/sum("value")).alias("pct")) #now you can select pct column from a a.select("pct").show()

subJobParams

外部作业不是并行运行?我在做什么错了?

1 个答案:

答案 0 :(得分:1)

请查看Build Flow Plugin文档的并行部分以获取详细信息。 要添加的是,下面是我在管道中使用的代码段。

stage('Name') {
  steps {
    script{
      container('tools') {
          parallel job1: {
              build job: 'path/to/the/job', parameters: [string(name: 'command', value: 'command-out')]
          }, job2: {
              build job: 'path/to/the/job', parameters: [string(name: 'command', value: 'command-out')]
          }, job3: {
              build job: 'path/to/the/job', parameters: [string(name: 'command', value: 'command-out')]
          }, job4: {
              build job: 'path/to/the/job', parameters: [string(name: 'command', value: 'command-out')]
          },
          failFast: true
      }
    }
  }
}