Package com.groupon.jenkins.dynamic.build

Examples of com.groupon.jenkins.dynamic.build.CurrentBuildState


    public Result runSubBuilds(Iterable<Combination> subBuildCombinations, BuildListener listener) throws InterruptedException, IOException {
        Iterable<DynamicSubProject> subProjects = getRunSubProjects(subBuildCombinations);
        scheduleSubBuilds(subBuildCombinations, listener);
        Result r = Result.SUCCESS;
        for (DynamicSubProject c : subProjects) {
            CurrentBuildState runState = waitForCompletion(c, listener);
            Result runResult = getResult(runState);
            r = r.combine(runResult);
            listener.getLogger().println("Run " + c.getName() + " finished with : " + runResult);
            subBuildFinishListener.runFinished(c.getBuildByNumber(dynamicBuild.getNumber()) );
        }
View Full Code Here


        // wait for the completion
        int appearsCancelledCount = 0;
        while (true) {
            Thread.sleep(1000);
            CurrentBuildState b = c.getCurrentStateByNumber(dynamicBuild.getNumber());
            if (b != null) { // its building or is done
                if (b.isBuilding()) {
                    continue;
                } else {
                    Result buildResult = b.getResult();
                    if (buildResult != null) {
                        return b;
                    }
                }
            } else { // not building or done, check queue
                Queue.Item qi = c.getQueueItem();
                if (qi == null) {
                    appearsCancelledCount++;
                    listener.getLogger().println(c.getName() + " appears cancelled: " + appearsCancelledCount);
                } else {
                    appearsCancelledCount = 0;
                }

                if (appearsCancelledCount >= 5) {
                    listener.getLogger().println(Messages.MatrixBuild_AppearsCancelled(ModelHyperlinkNote.encodeTo(c)));
                    return new CurrentBuildState("COMPLETED", Result.ABORTED);
                }
            }

        }
    }
View Full Code Here

    public CurrentBuildState getCurrentStateByNumber(DbBackedProject project, int number) {
        DbBackedBuild build = getQuery(project).field("number").equal(number).get();
        if(build == null) {
            return null;
        } else {
            return new CurrentBuildState(build.getState(), build.getResult());
        }
    }
View Full Code Here

TOP

Related Classes of com.groupon.jenkins.dynamic.build.CurrentBuildState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.