Package com.nirima.jenkins.repo.build

Examples of com.nirima.jenkins.repo.build.ProjectBuildRepositoryRoot


            return "maven-repository";
        }

        public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
            plugin.serveRequest(
                    new BridgeRepository(new ProjectBuildRepositoryRoot(null, build, build.getFullDisplayName()), null),
                    req.findAncestor(this).getUrl());
        }
View Full Code Here


                    public void visitModuleSet(MavenModuleSetBuild run)
                    {
                        BuildData bd = run.getAction(BuildData.class);
                        if (bd != null && run.getResult() == Result.SUCCESS) {
                            String sha1 = bd.getLastBuiltRevision().getSha1String();
                            RepositoryElement content = new ProjectBuildRepositoryRoot(AllSHA1RepositoryRoot.this,run,sha1);
                            add(content, false);

                        }
                    }
                });
View Full Code Here

            Function<Run, ProjectBuildRepositoryRoot> fn;

            fn = new Function<Run, ProjectBuildRepositoryRoot>() {

                public ProjectBuildRepositoryRoot apply(Run r) {
                    return new ProjectBuildRepositoryRoot(ProjectBuildList.this, r, "" + r.getNumber());
                }
            };

            // Transform builds into items
            Iterable<ProjectBuildRepositoryRoot> i = Iterables.transform(item.asProject().getBuilds(), fn);

            // Remove NULL entries
            return Lists.newArrayList(Iterables.filter(i, new Predicate<ProjectBuildRepositoryRoot>() {
                public boolean apply(ProjectBuildRepositoryRoot projectBuildRepositoryRoot) {
                    return projectBuildRepositoryRoot != null;
                }
            }));

        } else {

            Map<String, ProjectBuildRepositoryRoot> children = new HashMap<String, ProjectBuildRepositoryRoot>();

            log.info("Getting builds from {}", item);

            for (Run run : item.asProject().getBuilds()) {
                try
                {
                    BuildData bd = run.getAction(BuildData.class);
                    if (bd != null && run.getResult() == Result.SUCCESS) {
                        String sha1 = bd.getLastBuiltRevision().getSha1String();

                        // Most recent, only if successful
                        if (!children.containsKey(sha1) && run.getResult().isBetterOrEqualTo(Result.SUCCESS)) {
                            children.put(sha1, new ProjectBuildRepositoryRoot(this, run, sha1));
                        }
                    }
                }
                catch(Exception ex)
                {
View Full Code Here

    public @Override Collection<? extends RepositoryElement> getChildren() {

        List<? extends RepositoryElement> ar =  Lists.newArrayList(
                new ProjectBuildList(this, item, ProjectBuildList.Type.SHA1),
                new ProjectBuildList(this, item, ProjectBuildList.Type.Build),
                new ProjectBuildRepositoryRoot(this, item.asProject().getLastSuccessfulBuild(), "LastSuccessful")
        );

        return ar;
    }
View Full Code Here

TOP

Related Classes of com.nirima.jenkins.repo.build.ProjectBuildRepositoryRoot

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.