简体   繁体   English

Jenkins参数化触发器插件:按顺序启动脚本

[英]Jenkins parameterized trigger plugin : launch scripts in order

how can I tell Jenkins to run my scripts in order : run script1, if script1 is finished run script2 and same for script3. 我如何告诉Jenkins按顺序运行我的脚本:如果script1完成,则运行script1,运行script2,对script3相同。 In my image, Jenkins doesn't run them in order (script3 can be launched first..). 在我的图像中,Jenkins没有按顺序运行它们(可以先启动script3。)。 I am using parameterized trigger plugin because each script needs parameters. 我使用参数化触发器插件,因为每个脚本都需要参数。 https://i.stack.imgur.com/AcFHb.png https://i.stack.imgur.com/AcFHb.png

If you are using a Pipeline, you can call the jobs serially from your "main" pipeline and pass parameters to each job. 如果使用管道,则可以从“主”管道中依次调用作业,并将参数传递给每个作业。

Taken from this example : 以下示例中获取

node {
    paramAValue = "paramAValue"
    paramBValue = "paramBValue"
    build job: 'script1', parameters: [[$class: 'StringParameterValue', name: 'ParamA', value: paramAValue], [$class: 'StringParameterValue', name: 'ParamB', value: paramBValue]]
    build job: 'script2', parameters: [[$class: 'StringParameterValue', name: 'ParamA', value: paramAValue], [$class: 'StringParameterValue', name: 'ParamB', value: paramBValue]]
    build job: 'script3', parameters: [[$class: 'StringParameterValue', name: 'ParamA', value: paramAValue], [$class: 'StringParameterValue', name: 'ParamB', value: paramBValue]]
}

To ensure that one completes before another runs, you could put them in different stages. 为确保一个程序在另一个程序运行之前完成,您可以将它们置于不同的阶段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM