Search in sources :

Example 1 with PncBuilder

use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuilder in project bacon by project-ncl.

the class PigFacade method cancel.

public static String cancel() {
    ImportResult importResult = context().getPncImportResult();
    if (importResult == null) {
        importResult = readPncEntities();
    }
    PncBuilder builder = new PncBuilder();
    return builder.cancelRunningGroupBuild(importResult.getBuildGroup().getId());
}
Also used : ImportResult(org.jboss.pnc.bacon.pig.impl.pnc.ImportResult) PncBuilder(org.jboss.pnc.bacon.pig.impl.pnc.PncBuilder)

Example 2 with PncBuilder

use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuilder in project bacon by project-ncl.

the class PigFacade method build.

public static GroupBuildInfo build(boolean tempBuild, boolean tempBuildTS, RebuildMode rebuildMode, boolean wait, boolean dryRun) {
    ImportResult importResult = context().getPncImportResult();
    if (importResult == null) {
        importResult = readPncEntities();
    }
    if (tempBuild) {
        log.info("Temporary build");
    }
    try (PncBuilder pncBuilder = new PncBuilder()) {
        GroupBuild groupBuild = pncBuilder.build(importResult.getBuildGroup(), tempBuild, tempBuildTS, rebuildMode, wait, dryRun);
        if (wait) {
            try (BuildInfoCollector buildInfoCollector = new BuildInfoCollector()) {
                return buildInfoCollector.getBuildsFromGroupBuild(groupBuild);
            }
        }
        log.info("Not waiting for build to finish.");
        return null;
    }
}
Also used : ImportResult(org.jboss.pnc.bacon.pig.impl.pnc.ImportResult) BuildInfoCollector(org.jboss.pnc.bacon.pig.impl.pnc.BuildInfoCollector) GroupBuild(org.jboss.pnc.dto.GroupBuild) PncBuilder(org.jboss.pnc.bacon.pig.impl.pnc.PncBuilder)

Aggregations

ImportResult (org.jboss.pnc.bacon.pig.impl.pnc.ImportResult)2 PncBuilder (org.jboss.pnc.bacon.pig.impl.pnc.PncBuilder)2 BuildInfoCollector (org.jboss.pnc.bacon.pig.impl.pnc.BuildInfoCollector)1 GroupBuild (org.jboss.pnc.dto.GroupBuild)1