13
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Jenkins Build Flow Pluginで複数のジョブを並列実行する

Posted at

Jenkinsで複数のジョブを続けて実行したい場合、Build Flow Plugin を使うと簡単なDSLで書くことができます。

複数のジョブを並列に実行したい場合は、単純にparallelで複数のジョブを並べるだけ。

parallel (
    { build("job1") },
    { build("job2") },
)

ビルドパラメータを等を使って、並列実行するジョブを動的に変更させたい場合は、クロージャのリストを作ってparallelに渡せばOK。

ビルドパラメータで、jobsという名前でカンマ区切りのビルド名を指定する場合は以下のような感じ。

def builds = []
params.jobs.split(',').each() { job ->
    builds.add( { build(job) })
}
parallel(builds)
13
15
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?