Hi Robin,
I'm sorry, I think I haven't made the subject clear.
The problem is, that I need node specific and external resources in one build. As we use the "one build - one node" convention, running the master step on the server would break this concept.
It would also mean, that the master step would reserve the external resource, but the node specific resource reservation has to be done by a child step (if the actual build execution cannot be done on the server).
The build will start running, when the external resource is available. It will not check for the node specific resource at first, because it is not referenced by the master step.
Using a variable could be a (indeed very ugly) workaround:
Resource "externalResourceAvailable", Node Selection script:
groovy: system.getConfiguration("root").getVar("externalResourceAvailable")?.value.equals("true")
Configurations:
Pre-Build Scipt:
groovy:
import com.pmease.quickbuild.persistence.SessionManager;
import com.pmease.quickbuild.variable.*;
def configuration = system.getConfiguration("root")
def var = configuration.getVar("externalResourceAvailable")
if (var?.value.equals("true")) {
SessionManager.openSession();
try {
var.setValue("false")
system.configurationManager.save(configuration)
} finally {
SessionManager.closeSession();
}
}
Post-Build Scipt:
groovy:
import com.pmease.quickbuild.persistence.SessionManager;
import com.pmease.quickbuild.variable.*;
def configuration = system.getConfiguration("root")
def var = configuration.getVar("externalResourceAvailable")
if (var?.value.equals("false")) {
SessionManager.openSession();
try {
var.setValue("true")
system.configurationManager.save(configuration)
} finally {
SessionManager.closeSession();
}
}
And adding resource "externalResourceAvailable" to the existing node selection criteria of the master step.
In my test setup this seems to work, but I'm worried about running into synchronization issues etc. under real world conditions.
Do you think this could work or are there problems predictable?