简体   繁体   English

如何在Jenkins工作流(管道)插件中执行作业dsl脚本

[英]How to execute job dsl script in Jenkins workflow (pipeline) plugin

I am trying to combine nice branching handling of Workflow Multibranch with powerfull Job-Dsl plugin Job generation. 我正在尝试将Workflow Multibranch的分支处理与强大的Job-Dsl插件作业生成相结合。 So basically I want branch to regenerate it's jobs from script in repository and run the main one. 所以基本上我希望分支从存储库中的脚本重新生成它的作业并运行主要的作业。

But I don't see a way to run Process Job DSLs step from workflow script. 但我没有看到从工作流脚本运行Process Job DSLs的方法。 May be there is a built in way to execute custom steps in Workflow, but I just can't find it. 可能有一种内置的方法来在Workflow中执行自定义步骤,但我找不到它。

您可以创建一个单独的作业来处理job-dsl,然后通过“build job:xxx”步骤从工作流中使用适当的参数调用它。

Not quite sure where you are going with this, but perhaps what you really want is multibranch binding for Job DSL, or to manually iterate branches. 不太清楚你要去哪里,但也许你真正想要的是Job DSL的多分支绑定,或者手动迭代分支。

Alternately, with Workflow alone you can probably accomplish your goal, whatever that is. 或者,仅使用Workflow,您就可以完成目标,无论是什么。

It seems that the jobDSL method can be used in the pipeline. 似乎jobDSL方法可以在管道中使用。

Have a look into the Snippet Generator to generate some code : 查看片段生成器以生成一些代码: 在此输入图像描述

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

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