Codota Logo
DurabilityHintJobProperty
Code IndexAdd Codota to your IDE (free)

How to use
DurabilityHintJobProperty
in
org.jenkinsci.plugins.workflow.job.properties

Best Java code snippets using org.jenkinsci.plugins.workflow.job.properties.DurabilityHintJobProperty (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: io.jenkins.jenkinsfile-runner/payload

/**
 * Main entry point invoked by the setup module
 */
public int run(Bootstrap bootstrap) throws Exception {
  Jenkins j = Jenkins.getInstance();
  WorkflowJob w = j.createProject(WorkflowJob.class, "job");
  w.addProperty(new DurabilityHintJobProperty(FlowDurabilityHint.PERFORMANCE_OPTIMIZED));
  w.setDefinition(new CpsScmFlowDefinition(
      new FileSystemSCM(bootstrap.jenkinsfile.getParent()), bootstrap.jenkinsfile.getName()));
  QueueTaskFuture<WorkflowRun> f = w.scheduleBuild2(0,
      new SetJenkinsfileLocation(bootstrap.jenkinsfile));
  b = f.getStartCondition().get();
  writeLogTo(System.out);
  f.get();    // wait for the completion
  return b.getResult().ordinal;
}
origin: jenkinsci/workflow-multibranch-plugin

@Test public void durabilityHintByPropertyStep() throws Exception {
  sampleRepo.init();
  sampleRepo.write("Jenkinsfile",
          "properties([durabilityHint('" + FlowDurabilityHint.SURVIVABLE_NONATOMIC.getName()+"')])\n"+
          "echo 'whynot'");
  sampleRepo.git("add", "Jenkinsfile");
  sampleRepo.git("commit", "--all", "--message=flow");
  WorkflowMultiBranchProject mp = r.jenkins.createProject(WorkflowMultiBranchProject.class, "p");
  mp.getSourcesList().add(new BranchSource(new GitSCMSource(null, sampleRepo.toString(), "", "*", "", false)));
  WorkflowJob p = scheduleAndFindBranchProject(mp, "master");
  r.waitUntilNoActivity();
  WorkflowRun b1 = p.getLastBuild();
  Assert.assertEquals(Result.SUCCESS, b1.getResult());
  DurabilityHintJobProperty prop = p.getProperty(DurabilityHintJobProperty.class);
  Assert.assertEquals(FlowDurabilityHint.SURVIVABLE_NONATOMIC, prop.getHint());
}
origin: jenkinsci/jenkinsfile-runner

/**
 * Main entry point invoked by the setup module
 */
public int run(Bootstrap bootstrap) throws Exception {
  Jenkins j = Jenkins.getInstance();
  WorkflowJob w = j.createProject(WorkflowJob.class, "job");
  w.addProperty(new DurabilityHintJobProperty(FlowDurabilityHint.PERFORMANCE_OPTIMIZED));
  w.setDefinition(new CpsScmFlowDefinition(
      new FileSystemSCM(bootstrap.jenkinsfile.getParent()), bootstrap.jenkinsfile.getName()));
  QueueTaskFuture<WorkflowRun> f = w.scheduleBuild2(0,
      new SetJenkinsfileLocation(bootstrap.jenkinsfile));
  b = f.getStartCondition().get();
  writeLogTo(System.out);
  f.get();    // wait for the completion
  return b.getResult().ordinal;
}
origin: jenkinsci/workflow-cps-plugin

/** Sets up a running build that is waiting on input. */
private static WorkflowRun runBasicPauseOnInput(JenkinsRule j, String jobName, int[] jobIdNumber, FlowDurabilityHint durabilityHint) throws Exception {
  WorkflowJob job = j.jenkins.createProject(WorkflowJob.class, jobName);
  job.setDefinition(new CpsFlowDefinition("input 'pause'", true));
  job.addProperty(new DurabilityHintJobProperty(durabilityHint));
  WorkflowRun run = job.scheduleBuild2(0).getStartCondition().get();
  ListenableFuture<FlowExecution> listener = run.getExecutionPromise();
  FlowExecution exec = listener.get();
  while(exec.getCurrentHeads().isEmpty() || (exec.getCurrentHeads().get(0) instanceof FlowStartNode)) {  // Wait until input step starts
    System.out.println("Waiting for input step to begin");
    Thread.sleep(50);
  }
  while(run.getAction(InputAction.class) == null) {  // Wait until input step starts
    System.out.println("Waiting for input action to get attached to run");
    Thread.sleep(50);
  }
  Thread.sleep(100L);  // A little extra buffer for persistence etc
  jobIdNumber[0] = run.getNumber();
  return run;
}
origin: jenkinsci/workflow-cps-plugin

if (job == null) {  // Job may already have been created
  job = jenkins.createProject(WorkflowJob.class, jobName);
  job.addProperty(new DurabilityHintJobProperty(hint));
  job.setDefinition(new CpsFlowDefinition(
      "echo 'first'\n" +
origin: jenkinsci/workflow-cps-plugin

/** Create and run a basic build before we mangle its persisted contents.  Stores job number to jobIdNumber index 0. */
private static WorkflowRun runBasicBuild(JenkinsRule j, String jobName, int[] jobIdNumber, FlowDurabilityHint hint) throws Exception {
  WorkflowJob job = j.jenkins.createProject(WorkflowJob.class, jobName);
  job.setDefinition(new CpsFlowDefinition("echo 'doSomething'", true));
  job.addProperty(new DurabilityHintJobProperty(hint));
  WorkflowRun run = j.buildAndAssertSuccess(job);
  jobIdNumber[0] = run.getNumber();
  assertCompletedCleanly(run);
  return run;
}
org.jenkinsci.plugins.workflow.job.propertiesDurabilityHintJobProperty

Most used methods

  • <init>
  • getHint

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • onRequestPermissionsResult (Fragment)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now