Skip to content

A easy and seamless way to create and use templates in Jenkins.

License

Notifications You must be signed in to change notification settings

skolberg/ez-templates

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Allows you to use any job as a template for another job with overridable parameters.

Creating a Template

You create a template by creating any project type. Just check the property "Allow this job to be used as a template".

Using a Template

  • Create a new job of the same job type as the template
  • Check the property "Use another job as a template" and enter the template's name
    • Ensure "Allow this job to be used as a template" is not checked
  • Click Apply.

Whenever the template job is saved, its config will automatically sync down to its implementations. It will also sync if you edit the implementation (i.e. you cannot override the template)

Customizing the implementation

Every time a template or implementation is saved, they sync. The implementation basically overwrites its config with that of the template. There are a few fields, however, that do not fully get synced. One of those is the Parameters.

Whenever a template syncs:

  • New parameters added to the template are added to the implementation
  • Old parameters removed from the template are removed from the implementation
    • Note that renaming a variable counts as a removal and addition - it's is not synched as a rename and you will lose any customization.
  • Default Values are not synced.

This is useful if you want to have one job for every branch. BRANCH can be a Parameter. On the template job the Default Value could be master and the implementation has release.

About

A easy and seamless way to create and use templates in Jenkins.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published