Package org.codinjutsu.tools.jenkins.model

Examples of org.codinjutsu.tools.jenkins.model.Build


    public void decorateChangeList(LocalChangeList localChangeList, ColoredTreeCellRenderer coloredTreeCellRenderer, boolean b, boolean b2, boolean b3) {
        BrowserPanel browserPanel = BrowserPanel.getInstance(project);
        //browserPanel.watch();
        Map<String, Job> jobs = browserPanel.getWatched();
        if (jobs.containsKey(localChangeList.getName())) {
            Build build = jobs.get(localChangeList.getName()).getLastBuild();
            String status = build.getStatus().getStatus();
            if (build.isBuilding()) {
                status = "Running";
            }
            coloredTreeCellRenderer.append(String.format(" - last build #%d: %s", build.getNumber(), status), SimpleTextAttributes.GRAYED_ATTRIBUTES);
            coloredTreeCellRenderer.repaint();
        }
    }
View Full Code Here


    private Map<String, Build> loadAndReturnNewLatestBuilds() {
        Map<String, Build> latestBuildMap = requestManager.loadJenkinsRssLatestBuilds(jenkinsAppSettings);
        Map<String, Build> newBuildMap = new HashMap<String, Build>();
        for (Map.Entry<String, Build> entry : latestBuildMap.entrySet()) {
            String jobName = entry.getKey();
            Build newBuild = entry.getValue();
            Build currentBuild = currentBuildMap.get(jobName);

            if (!jenkinsAppSettings.shouldDisplayOnLogEvent(newBuild)) {
                continue;
            }
View Full Code Here

    }

    private void displayTheFirstFailedBuildInABalloon(Map.Entry<String, Build> firstFailedBuild) {
        if (firstFailedBuild != null) {
            String jobName = firstFailedBuild.getKey();
            Build build = firstFailedBuild.getValue();
            String message = jobName + "#" + build.getNumber() + ": FAILED";
            displayErrorMessageInABalloon(message);
        }
    }
View Full Code Here

        });
    }

    private Map.Entry<String, Build> getFirstFailedBuild(Map<String, Build> finishedBuilds) {
        for (Map.Entry<String, Build> buildByJobName : finishedBuilds.entrySet()) {
            Build build = buildByJobName.getValue();
            if (build.getStatus() == BuildStatusEnum.FAILURE) {
                return buildByJobName;
            }
        }
        return null;
    }
View Full Code Here

        }
        return false;
    }

    public static SimpleTextAttributes getAttribute(Job job) {
        Build build = job.getLastBuild();
        if (build != null) {
            if (job.isInQueue() || build.isBuilding()) {
                return SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES;
            }
        }

        return SimpleTextAttributes.REGULAR_ATTRIBUTES;
View Full Code Here

    }


    public static String buildLabel(Job job) {

        Build build = job.getLastBuild();
        if (build == null) {
            return job.getName();
        }
        String status = "";
        if (job.isInQueue()) {
            status = " (in queue)";
        } else if (build.isBuilding()) {
            status = " (running)";
        }
        return String.format("%s #%s%s", job.getName(), build.getNumber(), status);
    }
View Full Code Here

TOP

Related Classes of org.codinjutsu.tools.jenkins.model.Build

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.