Hi,
That's the first time I do this.
So far I've been able to call the exclusion plugin like this :
id = new org.jvnet.hudson.plugins.exclusion.DefaultIdType('test');
wrap([$class: 'IdAllocator',ids:[id]]){
step([$class: 'CriticalBlockStart'])
etc....
}
the first issue was that this plugin use the environment variable to pass the allocated resources : (CriticalBlockStart.java) :
EnvVars environment = run.getEnvironment(taskListener);
final List<String> listId = new ArrayList<String>();
// Add to a list all "variableEnv" (which are added by IdAllocator)
// Each variableEnv is a resource
for (Entry<String, String> e: environment.entrySet()) {
String cle = e.getKey();
String name = "variableEnv" + run.getParent().getName();
if (cle.contains(name)) {
String value = e.getValue();
listId.add(value);
}
}
The problem was that for the moment the SimpleBuildStep does not provide an EnvVar as a parameter like the SimpleBuildWrapper (JENKINS-29144)
So I'm trying to play on a file that could pass informations (key=value) from the wrapper to the buildstep,
I'm thinking of writting a configuration file on the master written by the wrapper that would be read by simplebuildstep. But I don't really know where to start.
If you have any suggestion on how to transmit the information from the wrapper to the simpleBuildStep without beeing able to read the EnvVars.
Thank you for your help.
Regards,
Pierre LEROUGE