jenkinsci / jenkinsci/lockable-resources-plugin

Create function lockNode()

Open
#341 0 comments 0 reactions 0 assignees View on GitHub
Good for Groovy shared library lock Jenkins node Triage
Dominant language
Java
Stars
99
Forks
205
Avg merge
2d 13h
Merged PRs (30d)
8

Description

### What feature do you want to see added?

Most of our locks are used to lock the node for whole pipeline time.
To explain. I have pipeline running on several nodes parallel. On every node we make setup. Synchronize it and then start the test. This must be running on all nodes at the same time. The problem is that setup on node 1 takes 2 minutes and on node 3 10 minutes. The node 1 will be free in jenkins for 8 minutes and there might be running other tasks which might broke my setup.

I think similar issue has many users.

Why new function? It will be great when the resources labels, description and name are equals to the node.
In this case will be possible to create direct link in the lockable resources to computer/node.

The function shall has an optional parameter
```
String nodeName = env.NODE_NAME
```
So the groovy might locked currently used node per default or given node name.

I do not care about node labels as parameter. It will be complicated to handle it on both sides (user groovy and plugin java). With this limitation I am very fine.

### Upstream changes

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.