Could you give me an example of a scripted Delivery Pipeline View for Jenkins Pipelines?

35 views
Skip to first unread message

Leslie Wittig Quintanilla

unread,
Mar 4, 2019, 5:37:41 PM3/4/19
to Delivery Pipeline Plugin
I read the blog post: http://blog.diabol.se/?p=1021
I'm able to create the view manually but I would very much like to do in a groovy file. Would you have an example of how to do it?

Best regards,
Leslie

to...@diabol.se

unread,
Mar 13, 2019, 10:17:55 AM3/13/19
to Delivery Pipeline Plugin
Hi Leslie,

If you plan to execute Groovy scripts on the Jenkins instance to configure your delivery pipeline views, e.g. as a part of the Jenkins startup you can make use of the classes available in the Delivery Pipeline plugin project (https://github.com/Diabol/delivery-pipeline-plugin) as long as they are available on your classpath.

Make use of the available setter methods to configure your view based on your preferences.

Example:

// DeliveryPipelineView is used for views based on traditional Jenkins jobs chained together as downstream dependencies
se.diabol.jenkins.pipeline.DeliveryPipelineView view =
new se.diabol.jenkins.pipeline.DeliveryPipelineView("My pipeline view");
view.setAllowPipelineStart(true);
view.setMaxNumberOfVisiblePipelines(10);
view.setLinkToConsoleLog(true);
view.setShowChanges(true);

// WorkflowPipelineView is used for views based on Jenkins pipelines
se.diabol.jenkins.workflow.WorkflowPipelineView workflowPipelineView =
new se.diabol.jenkins.workflow.WorkflowPipelineView("My jenkins pipeline view");
workflowPipelineView.setAllowPipelineStart(true);

Use the setComponentSpecs(List<ComponentSpec>) setter method to configure which pipelines to show in the view.

If you would like to contribute to the project with a proper example for your use case we would be happy to incorporate such an example in the docs directory of the project.

Hope that this information helps.

Best regards,
Tommy Tynjä
Maintainer of the Jenkins Delivery Pipeline plugin
Diabol AB
https://www.diabol.se/


Reply all
Reply to author
Forward
0 new messages