How can I run a build configuration in a script?
I'm reading a file and setting different variables in different configurations and I want to start the build configurations while iterating the file.
Thank you !!!
groovy:
import java.io.*;
import com.pmease.quickbuild.variable.*;
import com.pmease.quickbuild.*;
String WorkspacePath = configuration.getWorkspaceDir().getAbsolutePath();
String RepoPath = vars.get("GIT_REPONAME_COMPILATIONFILE").getValue();
String pathIni = WorkspacePath + "\" + RepoPath +"\Compilacions.txt ";
logger.info("-> $pathIni ");
File file = new File(pathIni);
BufferedReader br = new BufferedReader(new FileReader(file));
String str;
String [] campos;
logger.info("Iniciamos la/s compilacion/es: ");
while ( (str = br.readLine()) != null )
{
if (str == "" || str.charAt(0) == '#' )
continue;
campos = str.split();
String Maquina = campos[0];
String MaquinaBranch = campos[1];
String LibtotalBranch = campos[2];
String PGTBranch = campos[3];
String TCPBranch = campos[4];
String SDKBranch = campos[5];
logger.info("READ: $Maquina $MaquinaBranch $LibtotalBranch $PGTBranch $TCPBranch $SDKBranch");
def conf = system.getConfiguration("root/" + Maquina);
if (conf == null)
{
logger.info("No Existe esta version de maquina");
throw new QuickbuildException("No extste el nombre de la maquina: " + Maquina + " en quick build");
}
conf.getVar("GIT_BRANCH_MACHINE").setValue(MaquinaBranch);
conf.getVar("GIT_BRANCH_LIBTOTAL").setValue(LibtotalBranch);
conf.getVar("GIT_BRANCH_PGT").setValue(PGTBranch);
conf.getVar("GIT_BRANCH_TCP").setValue(TCPBranch);
conf.getVar("GIT_BRANCH_SDK").setValue(SDKBranch);
system.configurationManager.save(conf);
// ****************************************** HEREEEEEEEEEEEEEE ********************************************************
// I NEED TO RUN THE CURRENT BUILD CONFIGURATION AND WAIT TILL IT FINISHES TO CONTINUE ITERATING THE FILE
// HOW?
// ****************************************** HEREEEEEEEEEEEEEE ********************************************************
}