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

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

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

Jenkins.setScmCheckoutRetryCount介绍

暂无

代码示例

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

  1. @Override
  2. public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
  3. try {
  4. // for compatibility reasons, this value is stored in Jenkins
  5. Jenkins.get().setScmCheckoutRetryCount(json.getInt("scmCheckoutRetryCount"));
  6. return true;
  7. } catch (IOException e) {
  8. throw new FormException(e,"quietPeriod");
  9. } catch (JSONException e) {
  10. throw new FormException(e.getMessage(), "quietPeriod");
  11. }
  12. }
  13. }

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

  1. @Override
  2. public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
  3. try {
  4. // for compatibility reasons, this value is stored in Jenkins
  5. Jenkins.getInstance().setScmCheckoutRetryCount(json.getInt("scmCheckoutRetryCount"));
  6. return true;
  7. } catch (IOException e) {
  8. throw new FormException(e,"quietPeriod");
  9. } catch (JSONException e) {
  10. throw new FormException(e.getMessage(), "quietPeriod");
  11. }
  12. }
  13. }

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

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

相关文章

Jenkins类方法