Create a custom builder or publisher

Issue

  • How do I create a custom builder with the templates plugin?
  • How do I create a custom publisher with the templates plugin?

Environment

  • CloudBees Jenkins Enterprise
  • CloudBees Template plugin

Resolution

The CloudBees template plugin allows you to create custom build or publish step which can be used in other Jenkins projects.

Note: The instructions below are for a new builder, however the same configuration also applies to a publisher (post build action) as well.

Steps to create a new builder/publisher:

  1. Go to New Item > and select the Builder/Publisher template
  2. Under the attributes section add all of the attributes you would like to configure. Attributes are the options when you navigate to the job configuration page. This allows you to customize the builder configuration.
  3. Once you configure all of the attributes, then configure a Shell/Batch script. This part you can put any shell or batch operation you would like this plugin to use. If you would like to use the attribute values from step 2, then you can obtain that information by doing ${AttributeID}, where AttributeID is the ID of the attribute.
  4. Save the configuration.

When you navigate to any new project the builder template that was made above should now be available in the build section.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.