jenkinsci / jenkinsci/lockable-resources-plugin

Assign locked resource names with extra keyword

Open
#209 2 comments 0 reactions 0 assignees View on GitHub
resource labels enhancement Triage variables exposed by lock actions
Dominant language
Java
Stars
99
Forks
205
Avg merge
2d 13h
Merged PRs (30d)
8

Description

I would like to run the following block before a `states`-block:

```
options {
lock(extra:
[
[label:'test-instance', variable: 'TEST_INSTANCE', quantity: 1, resource: null],
[label:'remote-dongle', variable: 'HOSTNAME', quantity: 1, resource: null],
[label:'local-dongle', variable: 'LOCALNAME', quantity: 1, resource: null]
],
inversePrecedence: false,
variable: 'LOCKED_RESOURCES'
)
}
```
I get a comma-separated list of the names of the 3 locked resources in `${LOCKED_RESOURCES}`. However, the order of the resource names is random and varies every time I run the pipeline. That is why I need to assign `variable` on a per-locked-resource base, which however currently does not work (the variables `${TEST_INSTANCE}`, `${HOSTNAME}`, `${LOCALNAME}` are simply `null`).

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.