Package hudson.model

Examples of hudson.model.Cause


        when(build.getResult()).thenReturn(Result.UNSTABLE);
        return this;
    }

    public DynamicBuildFactory upstreamStart(String branch) {
        Cause cause = mock(UpstreamCause.class);
        when(build.getCauses()).thenReturn(Lists.newArrayList(cause));
        addBranchParam(branch);
        return this;
    }
View Full Code Here


    // skip analysis, when all causes from blacklist
    List<Cause> causes = new ArrayList<Cause>(build.getCauses());
    Iterator<Cause> iter = causes.iterator();
    while (iter.hasNext()) {
      Cause cause = iter.next();
      if (SCMTrigger.SCMTriggerCause.class.isInstance(cause) && isSkipScmCause()) {
        iter.remove();
      } else if (Cause.UpstreamCause.class.isInstance(cause) && isSkipUpstreamCause()) {
        iter.remove();
      }
View Full Code Here

        return "Build triggered.";
    }


    private GitlabCause getCause(AbstractBuild build) {
        Cause cause = build.getCause(GitlabCause.class);

        if (cause == null || !(cause instanceof GitlabCause)) {
            return null;
        }
View Full Code Here

      String senderId = sender.getId();
      if (senderId == null) {
          senderId = sender.getNickname();
      }
     
    Cause cause = new IMCause("Started by " + bot.getImId() + " on request of '" + senderId + "'");
    if (parameters.isEmpty()) {
        return project.scheduleBuild(delaySeconds, cause);
    } else {
        return project.scheduleBuild(delaySeconds, cause, new ParametersAction(parameters));
    }
View Full Code Here

            + project.getDisplayName());
    }

    SubResult subResult = masterResult.getResult(project.getDisplayName());
    int rebuildNumber = subResult.getBuildNumbers().size();
    Cause cause = new MasterBuildCause(this, rebuildNumber);
    rebuild(project, cause);
  }
View Full Code Here

      throws InterruptedException, IOException {
    MasterBuild masterBuild = (MasterBuild) build;
    Set<AbstractProject> subProjects = masterBuild.getSubProjects();
    Set<AbstractProject> hiddenSubProjects = masterBuild.getHiddenSubProjects();

    Cause cause = new MasterBuildCause(masterBuild);

    scheduleBuilds(masterBuild, subProjects, cause, listener);

    scheduleHiddenBuilds(masterBuild, hiddenSubProjects, cause, listener);
View Full Code Here

                MasterBuildCause currentCause =
                    (MasterBuildCause) build.getCause(MasterBuildCause.class);
                int rebuildNumber = currentCause.getRebuildNumber();
                if (result.isWorseThan(Result.SUCCESS)
                    && rebuildNumber < maxRetries) {
                  Cause newCause =
                      new MasterBuildCause(masterBuild, rebuildNumber + 1);
                  this.masterBuild.rebuild(project, newCause);
                  projectBuildMap.remove(project);
                  causeMap.put(project, newCause);
                  logger.printf("!!!REBUILDING!!! %s (%s%s%s)\n",
                      project.getDisplayName(),
                      hudson.getRootUrl(),
                      build.getUrl(),
                      page);
                } else {
                  completed.add(project);
                }
              }
          } else {
              Cause cause = causeMap.containsKey(project)
                  ? causeMap.get(project) : this.cause;
              build = buildFinder.findBuild(project, cause);
              if (build != null) {
                  masterBuild.addSubBuild(
                      project.getDisplayName(),
View Full Code Here

    }
    return false;
  }
 
    private GhprbCause getCause(AbstractBuild<?, ?> build) {
        Cause cause = build.getCause(GhprbCause.class);
        if (cause == null || (!(cause instanceof GhprbCause))) return null;
        return (GhprbCause) cause;
    }
View Full Code Here

    private boolean cancelBuild(int id) {
        return false;
    }

    private GhprbCause getCause(AbstractBuild<?,?> build) {
        Cause cause = build.getCause(GhprbCause.class);
        if (cause == null || (!(cause instanceof GhprbCause))) return null;
        return (GhprbCause) cause;
    }
View Full Code Here

        }
        return new UpstreamCause((Run) build);
    }

    protected Future schedule(AbstractBuild<?, ?> build, AbstractProject project, int quietPeriod, List<Action> list) throws InterruptedException, IOException {
        Cause cause = createUpstreamCause(build);
        return project.scheduleBuild2(quietPeriod,
                cause,
                list.toArray(new Action[list.size()]));
    }
View Full Code Here

TOP

Related Classes of hudson.model.Cause

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.