简体   繁体   English

如何在詹金斯创建构建管道?

[英]How to create build pipeline in Jenkins?

How to create build pipeline view in Jenkins using Jenkins CLI or through scripting? 如何使用Jenkins CLI或通过脚本在Jenkins中创建构建管道视图? I would prefer CLI if possible. 如果可能,我希望使用CLI。

Right now I create a Bunch of jobs including downstream. 现在,我创建了一堆工作,包括下游工作。 So would prefer a way to automate pipeline view. 因此,更希望有一种自动化管道视图的方法。

Step 1: For creating a build pipeline, First create a set of jobs. 步骤1:对于创建构建管道,首先创建一组作业。 管道作业

Step 2: Now create a build pipeline view and in the configure section add the first job that you want to run in the pipeline 步骤2:现在创建构建管道视图,并在configure部分中添加要在管道中运行的第一个作业

新管道视图

Step 3:Now for every job, add a post build action, which can be modified many ways, for example manual trigger or automatic trigger on successful of the build. 步骤3:现在,为每个作业添加一个构建后操作,可以用多种方式对其进行修改,例如,手动触发或构建成功后自动触发。

下游项目

step 4: Once all the downstream jobs are configured, just build the p1 job. 步骤4:配置完所有下游作业后,只需构建p1作业即可。 and go to the new pipeline view that you have created. 并转到您创建的新管道视图。

在此处输入图片说明

Note: You won't see a pipeline untill first job is started. 注意:在开始第一个作业之前,您不会看到管道。 In this example, after p1 job is started you will start seeing a pipeline 在此示例中,启动p1作业后,您将开始看到管道

Use BUILD FLOW plugin, in which you can use simple DSL scripts. 使用BUILD FLOW插件,您可以在其中使用简单的DSL脚本。

By using this plugin you can build both pipeline & parallel jobs 通过使用此插件,您可以构建管道作业和并行作业

You can use the Job DSL Plugin to define a Build Pipeline View and any jobs for the pipeline. 您可以使用Job DSL插件来定义构建管道视图以及该管道的所有作业。

If you want to run the DSL from CLI, you can checkout the REST API Runner . 如果要从CLI运行DSL,可以签出REST API Runner

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

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