jenkinsci / jenkinsci/lockable-resources-plugin
[JENKINS-29585] Allow selecting resources from axis values of matrix projects
- Dominant language
- Java
- Stars
- 99
- Forks
- 205
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 8
Description
Here are two scenarios that are currently impossible to implement properly.
Scenario 1:
There are 4 DB servers. Two servers run RDBMS version 1 and two servers run RDBMS version 2. There is a product that must work with both versions of RDBMS. There is a matrix job that has axis "db" with values "1" and "2".
- It should be possible for the build with configuration "db=1" to lock one of RDBMS with version 1 and for the build with configuration "db=2" to lock one of RDBMS with version 2.
Scenario 2:
There is a pool of DB servers. These servers require some periodic maintenance (DB restart, health check, cleanup, whatever). There is a cleanup matrix job with ElasticAxis axis iterating over a label whose all DB servers have (ElasticAxis node=db).
- It should be possible to lock each build according to its configuration that is value of label node.
The easiest way seems to be to threat "label" parameter of job configuration for lockable-resources-plugin as a groovy expression. This groovy expression can access build configuration, axis values, etc and produce the resource label to be actually used to search for resources.
---
Originally reported by
nickolay_martinov, imported from: Allow selecting resources from axis values of matrix projects
Raw content of original issue
Here are two scenarios that are currently impossible to implement properly.
Scenario 1:
There are 4 DB servers. Two servers run RDBMS version 1 and two servers run RDBMS version 2. There is a product that must work with both versions of RDBMS. There is a matrix job that has axis "db" with values "1" and "2".
- It should be possible for the build with configuration "db=1" to lock one of RDBMS with version 1 and for the build with configuration "db=2" to lock one of RDBMS with version 2.
Scenario 2:
There is a pool of DB servers. These servers require some periodic maintenance (DB restart, health check, cleanup, whatever). There is a cleanup matrix job with ElasticAxis axis iterating over a label whose all DB servers have (ElasticAxis node=db).
- It should be possible to lock each build according to its configuration that is value of label node.
The easiest way seems to be to threat "label" parameter of job configuration for lockable-resources-plugin as a groovy expression. This groovy expression can access build configuration, axis values, etc and produce the resource label to be actually used to search for resources.
- environment:
1.6
3 attachments
- [[Untitled]001.jpg](https://issues.jenkins.io/secure/attachment/30230/%5BUntitled%5D001.jpg)
> ![[Untitled]001.jpg](https://issues.jenkins.io/secure/attachment/30230/%5BUntitled%5D001.jpg)
- [[Untitled]002.jpg](https://issues.jenkins.io/secure/attachment/30231/%5BUntitled%5D002.jpg)
> ![[Untitled]002.jpg](https://issues.jenkins.io/secure/attachment/30231/%5BUntitled%5D002.jpg)
- [[Untitled]003.jpg](https://issues.jenkins.io/secure/attachment/30232/%5BUntitled%5D003.jpg)
> ![[Untitled]003.jpg](https://issues.jenkins.io/secure/attachment/30232/%5BUntitled%5D003.jpg)
Contributor guide
Assessment
This issue has not been assessed yet.