0

How to create build pipeline view in Jenkins using Jenkins CLI or through scripting? I would prefer CLI if possible.

Right now I create a Bunch of jobs including downstream. So would prefer a way to automate pipeline view.

halfer
  • 19,824
  • 17
  • 99
  • 186
enthuguy
  • 405
  • 2
  • 8
  • 20

3 Answers3

3

Step 1: For creating a build pipeline, First create a set of jobs. Pipeline jobs

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

New pipe line view

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.

downstream projects

step 4: Once all the downstream jobs are configured, just build the p1 job. and go to the new pipeline view that you have created.

enter image description here

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

chanukhya bachina
  • 171
  • 1
  • 3
  • 16
0

Use BUILD FLOW plugin, in which you can use simple DSL scripts.

By using this plugin you can build both pipeline & parallel jobs

mahinlma
  • 1,208
  • 3
  • 11
  • 24
  • thx, I can build pipeline dynamically using jenkins cli, but after creating this pipeline...would like to create a new pipeline view and associate the parent job dynamically through scripting as well. – enthuguy Mar 03 '16 at 08:02
0

You can use the Job DSL Plugin to define a Build Pipeline View and any jobs for the pipeline.

If you want to run the DSL from CLI, you can checkout the REST API Runner.

daspilker
  • 8,154
  • 1
  • 35
  • 49