jenkins.model.Jenkins.setScmCheckoutRetryCount()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(216)

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

Jenkins.setScmCheckoutRetryCount介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

@Override
  public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
    try {
      // for compatibility reasons, this value is stored in Jenkins
      Jenkins.get().setScmCheckoutRetryCount(json.getInt("scmCheckoutRetryCount"));
      return true;
    } catch (IOException e) {
      throw new FormException(e,"quietPeriod");
    } catch (JSONException e) {
      throw new FormException(e.getMessage(), "quietPeriod");
    }
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

@Override
  public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
    try {
      // for compatibility reasons, this value is stored in Jenkins
      Jenkins.getInstance().setScmCheckoutRetryCount(json.getInt("scmCheckoutRetryCount"));
      return true;
    } catch (IOException e) {
      throw new FormException(e,"quietPeriod");
    } catch (JSONException e) {
      throw new FormException(e.getMessage(), "quietPeriod");
    }
  }
}

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

@Issue("JENKINS-39194")
@Test public void retry() throws Exception {
  // We use an un-initialized repo here to test retry
  WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
  GitStep step = new GitStep(invalidRepo.toString());
  CpsScmFlowDefinition def = new CpsScmFlowDefinition(step.createSCM(), "flow.groovy");
  def.setLightweight(false);
  p.setDefinition(def);
  r.jenkins.setScmCheckoutRetryCount(1);
  WorkflowRun b = r.assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0));
  r.assertLogContains("Could not read from remote repository", b);
  r.assertLogContains("Retrying after 10 seconds", b);
}

相关文章

Jenkins类方法