Home > Blockchain >  Please explain jenkins lockable-resources plugin practical use
Please explain jenkins lockable-resources plugin practical use

Time:06-14

I could not understand the purpose of the plugin, Lockable Resources.

In the documentation it is written that it locks resource "such as printers, phones (what!?), computers, etc"

I coudn't get what exactly it's locks and from whom? Please explain somebody on example.

CodePudding user response:

It prevents two jobs from attempting to use the same resource at the same time. A "resource" can be anything you want. It's identified by a name.

Consider a contrived example: You've got a Jenkins job that prints some envelopes and then some letters. If another job runs at the same time, your envelopes and letters will be mixed up. In order to prevent another job from using that printer while your job is running, you can have both jobs use a resource lock for that printer.

Or maybe you're using a pen-plotter with colour separation, so that each of the primary colours is a separate step. Your job should lock the plotter across all of the steps so that another job can't start plotting its image over the top.

You can already prevent Jenkins from running multiple instances of the same job at the same time; this is to prevent two different jobs from using the same resource at the same time.

  • Related