to use Quickbuild effectively, you should know how to use built-in script(OGNL). Though there is complete script reference, it's not easy to use it at first time. so It would be helpful for Quickbuild newbie to share these script snippet.
based on Quickbuild V3.x
+ Getting workspace directory of 'root/dev' on specific node.
${system.getConfigurationManager().get("root/dev").getWorkspaceDir()}
or
${system.getConfiguration("root/dev").getWorkspaceDir()}
+ Getting revision of last successful build of 'root/dev'
${system.getConfiguration("root/dev").getLatestSuccessfulBuild().getRepository("repo").getRevision()}
+ If TXT variable is equal to node's attribute value of 'CAP_GCC' returns true. otherwise returns false. This can be used at 'node match condition'.
node.getAttribute("CAP_GCC").equals("${vars.get("TXT")}")
+ check if this node is Windows OS
grid.getNode(params.get("nodes")).getAttribute("WRAPPER_OS").equals("windows")
+ return true if all specified step is successful
steps.get("master>sync").isSuccessful()&&steps.get("master>sdk").isSuccessful()&&steps.get("master>publish").isSuccessful()+ select a build agent which doesn't have any job. this can be used at 'node match condition'
node.isBuildAgent() && (node.getJobCount()==0)+ previous step is successful and check specific variable
current.getPreviousSibling().isSuccessful()&&vars.get("isPrevent").value=="no"+ add -c option when clean option checked
${vars.getValue("clean")=="yes"?"-c":""}
I am wondering if you have other scripts for QB you can share?
답글삭제Trying to learn QB to improve career options. Would appreciate any help.
If you ask anything i know, i surely answer it
답글삭제