Running Jenkins parallel tasks sequentially

前端 未结 2 1471
醉话见心
醉话见心 2021-01-22 02:16

I\'m writing a new Jenkins pipeline and have a set of steps that I would eventually like to run in parallel. But while I\'m developing this pipeline I\'d like to force it to ru

相关标签:
2条回答
  • 2021-01-22 02:49

    I don't know any way to run parallel steps in jenkins. You can run parallel jobs in the same node or in different nodes.

    Running parallel jobs

    parallel (
    // job 1, 2 and 3 will be scheduled in parallel.
    { build("job1") },
    { build("job2") },
    { build("job3") }
    )
    

    You can make a job for each cleanup*.sh and call these jobs like above.

    A more simple approach is use parallel command

    Or simplest

    clenaup1.sh &! clenaup3.sh &! clenaup4.sh &! ...
    
    0 讨论(0)
  • 2021-01-22 02:56

    Instead of parallel cleanupScripts you can use like this:

    cleanupScripts.each{ key, value ->
        value()
    }
    
    0 讨论(0)
提交回复
热议问题