Package hudson.model

Examples of hudson.model.Run


    @Override
    protected File dir() {
        if (this.project instanceof AbstractProject) {
            AbstractProject abstractProject = (AbstractProject) this.project;

            Run run = abstractProject.getLastCompletedBuild();
            if (run != null) {
                File javadocDir = getBuildArchiveDir(run);

                if (javadocDir.exists()) {
                    return javadocDir;
View Full Code Here


          trigger = false;
        }
        else {
          AbstractBuild<?,?> dlb = downstreamProject.getLastBuild(); // can be null.
          for (AbstractMavenProject up : Util.filter(downstreamProject.getUpstreamProjects(),AbstractMavenProject.class)) {
            Run ulb;
            if(up==parent) {
              // the current build itself is not registered as lastSuccessfulBuild
              // at this point, so we have to take that into account. ugly.
              if(build.getResult()==null || !build.getResult().isWorseThan(Result.UNSTABLE))
                ulb = build;
              else
                ulb = up.getLastSuccessfulBuild();
            } else
              ulb = up.getLastSuccessfulBuild();
            if(ulb==null) {
              // if no usable build is available from the upstream,
              // then we have to wait at least until this build is ready
              if(AbstractMavenBuild.debug)
                listener.getLogger().println(" -> No, because another upstream "+up+" for "+downstreamProject+" has no successful build");
              trigger = false;
              break;
            }

            // if no record of the relationship in the last build
            // is available, we'll just have to assume that the condition
            // for the new build is met, or else no build will be fired forever.
            if(dlb==null)   continue;
            int n = dlb.getUpstreamRelationship(up);
            if(n==-1)   continue;

            assert ulb.getNumber()>=n;
          }
        }         
        return trigger;
      }
View Full Code Here

        if (j!=null) {
            Item job = Jenkins.getInstance().getItemByFullName(j);
            binding.setProperty("currentJob", job);
            String b = getClientEnvironmentVariable("BUILD_NUMBER");
            if (b!=null && job instanceof AbstractProject) {
                Run r = ((AbstractProject) job).getBuildByNumber(Integer.parseInt(b));
                binding.setProperty("currentBuild", r);
            }
        }

        GroovyShell groovy = new GroovyShell(Jenkins.getInstance().getPluginManager().uberClassLoader, binding);
View Full Code Here

            Job j = Jenkins.getInstance().getItemByFullName(envs[0],Job.class);
            if (j==null)    throw new CmdLineException("No such job: "+envs[0]);

            try {
                Run r = j.getBuildByNumber(Integer.parseInt(envs[1]));
                if (r==null)    throw new CmdLineException("No such build #"+envs[1]+" in "+envs[0]);
                return r;
            } catch (NumberFormatException e) {
                throw new CmdLineException("Invalid build number: "+envs[1]);
            }
View Full Code Here

    @SuppressWarnings("rawtypes")
    public void perform(Job<?,?> job) throws IOException, InterruptedException {
        LOGGER.log(FINE,"Running the log rotation for "+job.getFullDisplayName());
       
        // always keep the last successful and the last stable builds
        Run lsb = job.getLastSuccessfulBuild();
        Run lstb = job.getLastStableBuild();

        if(numToKeep!=-1) {
            List<? extends Run<?,?>> builds = job.getBuilds();
            for (Run r : builds.subList(Math.min(builds.size(),numToKeep),builds.size())) {
                if (r.isKeepLog()) {
View Full Code Here

            List<AbstractProject> noFingerprints = new ArrayList<AbstractProject>();
            for (AbstractProject job : getJobs()) {
                RangeSet rs = owner.getDownstreamRelationship(job);
                if(rs.isEmpty()) {
                    // is this job expected to produce a test result?
                    Run b;
                    if (includeFailedBuilds) {
                        b = job.getLastBuild();
                    } else {
                        b = job.getLastSuccessfulBuild();
                    }
                    if(b!=null && b.getAction(AbstractTestResultAction.class)!=null) {
                        if(b.getAction(FingerprintAction.class)!=null) {
                            didntRun.add(job);
                        } else {
                            noFingerprints.add(job);
                        }
                    }
                } else {
                    for (int n : rs.listNumbersReverse()) {
                        Run b = job.getBuildByNumber(n);
                        if(b==null) continue;
                        Result targetResult;
                        if (includeFailedBuilds) {
                            targetResult = Result.FAILURE;
                        } else {
                            targetResult = Result.UNSTABLE;
                        }
                       
                        if(b.isBuilding() || b.getResult().isWorseThan(targetResult))
                            continue;   // don't count them

                        for( AbstractTestResultAction ta : b.getActions(AbstractTestResultAction.class)) {
                            failCount += ta.getFailCount();
                            totalCount += ta.getTotalCount();
                            individuals.add(ta);
                        }
                        break;
View Full Code Here

        if (enableFingerprintsInDependencyGraph) {
            RunList builds = owner.getBuilds();
            Set<String> seenUpstreamProjects = new HashSet<String>();

            for ( ListIterator iter = builds.listIterator(); iter.hasNext(); ) {
                Run build = (Run) iter.next();
                List<FingerprintAction> fingerprints = build.getActions(FingerprintAction.class);
                for (FingerprintAction action : fingerprints) {
                    Map<AbstractProject,Integer> deps = action.getDependencies();
                    for (AbstractProject key : deps.keySet()) {
                        if (key == owner) {
                            continue;   // Avoid self references
View Full Code Here

    /**
     * Filter the list to non-successful builds only.
     */
    public RunList<R> failureOnly() {
        for (Iterator<R> itr = iterator(); itr.hasNext();) {
            Run r = itr.next();
            if(r.getResult()==Result.SUCCESS)
                itr.remove();
        }
        return this;
    }
View Full Code Here

    /**
     * Filter the list to builds on a single node only
     */
    public RunList<R> node(Node node) {
        for (Iterator<R> itr = iterator(); itr.hasNext();) {
            Run r = itr.next();
            if (!(r instanceof AbstractBuild) || ((AbstractBuild)r).getBuiltOn()!=node) {
                itr.remove();
            }
        }
        return this;
View Full Code Here

    /**
     * Filter the list to regression builds only.
     */
    public RunList<R> regressionOnly() {
        for (Iterator<R> itr = iterator(); itr.hasNext();) {
            Run r = itr.next();
            if(!r.getBuildStatusSummary().isWorse)
                itr.remove();
        }
        return this;
    }
View Full Code Here

TOP

Related Classes of hudson.model.Run

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.