hudson.model.Run.toString()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中hudson.model.Run.toString方法的一些代码示例,展示了Run.toString的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Run.toString方法的具体详情如下:
包路径:hudson.model.Run
类名称:Run
方法名:toString

Run.toString介绍

暂无

代码示例

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

public String superToString() {
  return super.toString();
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

public void setResult(Result r) {
  // state can change only when we are building
  // roy: can also change during testing
  // assert state == State.BUILDING;
  // result can only get worse
  if (result == null) {
    result = r;
    LOGGER.log(FINE, toString() + " : result is set to " + r);
  } else {
    if (r.isWorseThan(result)) {
      LOGGER.log(FINE, toString() + " : result is set to " + r);
      result = r;
    }
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

public void setResult(Result r) {
  // state can change only when we are building
  assert state==State.BUILDING;
  // result can only get worse
  if(result==null) {
    result = r;
    LOGGER.log(FINE, toString()+" : result is set to "+r,new Exception());
  } else {
    if(r.isWorseThan(result)) {
      LOGGER.log(FINE, toString()+" : result is set to "+r,new Exception());
      result = r;
    }
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public void setResult(Result r) {
  // state can change only when we are building
  assert state==State.BUILDING;
  // result can only get worse
  if(result==null) {
    result = r;
    LOGGER.log(FINE, toString()+" : result is set to "+r,new Exception());
  } else {
    if(r.isWorseThan(result)) {
      LOGGER.log(FINE, toString()+" : result is set to "+r,new Exception());
      result = r;
    }
  }
}

代码示例来源:origin: hudson/hudson-2.x

public void setResult(Result r) {
  // state can change only when we are building
  assert state==State.BUILDING;
  // result can only get worse
  if(result==null) {
    result = r;
    LOGGER.log(FINE, toString()+" : result is set to "+r,new Exception());
  } else {
    if(r.isWorseThan(result)) {
      LOGGER.log(FINE, toString()+" : result is set to "+r,new Exception());
      result = r;
    }
  }
}

代码示例来源:origin: jenkinsci/tfs-plugin

@Override
  public void onCompleted(final Run run, @Nonnull final TaskListener listener) {
    log.info("onCompleted: " + run.toString());
    if (UnsupportedIntegrationAction.isSupported(run, listener)) {
      final TeamCompletedStatusPostBuildAction step = new TeamCompletedStatusPostBuildAction();
      step.perform(run, listener);
    }
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Called when a job finished building normally or abnormally.
 */
protected void onEndBuilding() {
  // signal that we've finished building.
  if (runner!=null) {
    // MavenBuilds may be created without their corresponding runners.
    state = State.COMPLETED;
    runner.checkpoints.allDone();
    runner = null;
    RunnerStack.INSTANCE.pop();
  } else {
    state = State.COMPLETED;
  }
  if (result == null) {
    result = Result.FAILURE;
    LOGGER.warning(toString() + ": No build result is set, so marking as failure. This shouldn't happen.");
  }
  RunListener.fireFinalized(this);
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Called when a job finished building normally or abnormally.
 */
protected void onEndBuilding() {
  // signal that we've finished building.
  if (runner!=null) {
    // MavenBuilds may be created without their corresponding runners.
    state = State.COMPLETED;
    runner.checkpoints.allDone();
    runner = null;
    RunnerStack.INSTANCE.pop();
  } else {
    state = State.COMPLETED;
  }
  if (result == null) {
    result = Result.FAILURE;
    LOGGER.warning(toString() + ": No build result is set, so marking as failure. This shouldn't happen.");
  }
  RunListener.fireFinalized(this);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Called when a job finished building normally or abnormally.
 */
protected void onEndBuilding() {
  // signal that we've finished building.
  if (runner!=null) {
    // MavenBuilds may be created without their corresponding runners.
    state = State.COMPLETED;
    runner.checkpoints.allDone();
    runner = null;
    RunnerStack.INSTANCE.pop();
  } else {
    state = State.COMPLETED;
  }
  if (result == null) {
    result = Result.FAILURE;
    LOGGER.warning(toString() + ": No build result is set, so marking as failure. This shouldn't happen.");
  }
  RunListener.fireFinalized(this);
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

@Override
public String toString() {
  initPython();
  if (pexec.isImplemented(26)) {
    return (String) pexec.execPython("to_string");
  } else {
    return super.toString();
  }
}

代码示例来源:origin: jenkinsci/gerrit-trigger-plugin

@Override
public String toString() {
  String s = "";
  Run theBuild = getBuild();
  if (theBuild != null) {
    s = theBuild.toString();
  } else {
    Job theProject = getProject();
    if (theProject != null) {
      s = theProject.getName();
    }
  }
  if (isBuildCompleted()) {
    s += " (completed)";
  }
  return s;
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Called when a job finished building normally or abnormally.
 */
protected void onEndBuilding() {
  // signal that we've finished building.
  if (runner != null) {
    // MavenBuilds may be created without their corresponding runners.
    setState(State.COMPLETED);
    runner.checkpoints.allDone();
    runner = null;
    RunnerStack.INSTANCE.pop();
  } else {
    setState(State.COMPLETED);
  }
  if (getResult() == null) {
    setResult(Result.FAILURE);
    LOGGER.warning(toString() + ": No build result is set, so marking as failure. This shouldn't happen.");
  }
  RunListener.fireFinalized(this);
}

代码示例来源:origin: jenkinsci/kubernetes-ci-plugin

@Override
protected void doPerform(Run<?, ?> run, TaskLogger taskLogger, ChartRepo chartRepo)
  throws ServiceException {
  taskLogger.info("Deploying chart [" + getChartName() + "] into namespace: " + getNamespace() );
  final String runName = (run != null) ? run.toString() : "<NO-RUN>";
  Map<String, String> label = Collections.singletonMap(JENKINS_JOB,
    StringUtils.deleteWhitespace(runName).replace('#', '_') );
  final Chart chart = deploymentService.deployChart(getKubeName(), getNamespace(), chartRepo, chartName, label);
  taskLogger.info("Chart [" + chartName + "] deployed");
  if (deleteChartWhenFinished && run instanceof FreeStyleBuild) {
    taskLogger.info("Chart [" + chartName + "] will be deleted at the end of the run");
    final DeployChartCleanup chartCleanup = new DeployChartCleanup(this, getNamespace(), chart, taskLogger);
    ((FreeStyleBuild) run).getEnvironments().add(0, chartCleanup);
  }
}

代码示例来源:origin: com.marvelution.jira.plugins/hudson-apiv2-plugin

LOGGER.log(Level.FINE, run.toString() + " has causes, locate the UserTrigger or ProjectTrigger");
for (Object cause : run.getCauses()) {
  Trigger trigger = DozerUtils.getMapper().map(cause, Trigger.class);
LOGGER.log(Level.FINE, run.toString() + " has no causes try its parent " + run.getParent().getParent().getFullName());
return getCulpritFromRunnable(((Job<?, ?>) run.getParent().getParent()).getBuildByNumber(run.getNumber()));

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Deletes the build when the button is pressed.
 */
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  requirePOST();
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why!=null) {
    sendError(Messages.Run_UnableToDelete(toString(),why),req,rsp);
    return;
  }
  delete();
  rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl());
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Deletes the build when the button is pressed.
 */
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  requirePOST();
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why!=null) {
    sendError(Messages.Run_UnableToDelete(toString(),why),req,rsp);
    return;
  }
  delete();
  rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl());
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Deletes the build when the button is pressed.
 */
public void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  requirePOST();
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why != null) {
    sendError(Messages.Run_UnableToDelete(toString(), why), req, rsp);
    return;
  }
  delete();
  rsp.sendRedirect2(req.getContextPath() + '/' + getParent().getUrl());
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Deletes the build when the button is pressed.
 */
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  requirePOST();
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why!=null) {
    sendError(Messages.Run_UnableToDelete(toString(),why),req,rsp);
    return;
  }
  delete();
  rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl());
}

代码示例来源:origin: io.jenkins.plugins/docker-slaves

String slaveName = "Container for " + run.toString() + "." + flowNode.getId();
String description = "Container building " + run.getParent().getFullName();

代码示例来源:origin: jenkinsci/docker-slaves-plugin

String slaveName = "Container for " + run.toString() + "." + flowNode.getId();
String description = "Container building " + run.getParent().getFullName();

相关文章

微信公众号

最新文章

更多

Run类方法