we use floating licenses for our more expensive compilers/tools, so that we can do local development as well as our production builds. The license manager (flexLM) has an api we can query, so we could block the license. However, I cannot find a mechanism by which I can cause my pipeline to queue based on the state of an auxiliary variable or return value of a script or something like that.
This means that I can launch the build on any machine on which the compiler is installed but it will then fail if the license is not available and I will have to relaunch the pipeline. If I did that automatically I would effectively just block that machine until the license becomes available.
Is there anything I have missed that could achieve a "queueing until license becomes available" kind of thing?
Thank you, Manuel
We can add the first task
power shellin the pipeline definition and define new variable in the variable tab such asValue:true, then add script to check the license status, if the license is available, set the variableValueto true, if the license is not available, set the variableValueto False. Then add conditioneq(variables['{variable name}'], '{variable value}')in the Second task.After configure, if your license is available, the pipeline will run successfully.
Or we could check the license first, then call the below script to queue build pipeline.