Package hudson.plugins.parameterizedtrigger

Examples of hudson.plugins.parameterizedtrigger.TriggerBuilder


    buildParameters.add(new CurrentBuildParameters());
    BlockingBehaviour neverFail = new BlockingBehaviour("never", "never", "never");
    BlockableBuildTriggerConfig config = new BlockableBuildTriggerConfig("projectB", neverFail, buildParameters);

    BlockableBuildTriggerConfig nonBlockingConfig = new BlockableBuildTriggerConfig("projectC", null, buildParameters);
    projectA.getBuildersList().add(new TriggerBuilder(config, nonBlockingConfig));

    CaptureEnvironmentBuilder builder = new CaptureEnvironmentBuilder();
    projectA.getBuildersList().add(builder);

    Project projectB = createFreeStyleProject("projectB");
View Full Code Here


  public void testProjectDeleted() throws Exception {
      FreeStyleProject p1 = createFreeStyleProject();
      FreeStyleProject p2 = createFreeStyleProject();
     
      // Blocked build
      p1.getBuildersList().add(new TriggerBuilder(new BlockableBuildTriggerConfig(
              p2.getName(),
              new BlockingBehaviour(
                      Result.FAILURE,
                      Result.UNSTABLE,
                      Result.FAILURE
              ),
              Arrays.<AbstractBuildParameters>asList(
                      new PredefinedBuildParameters("test=test")
              )
      )));
     
      FreeStyleBuild blockedBuild = p1.scheduleBuild2(0).get();
      assertBuildStatusSuccess(blockedBuild);
     
      // Unblocked build
      p1.getBuildersList().clear();
      p1.getBuildersList().add(new TriggerBuilder(new BlockableBuildTriggerConfig(
              p2.getName(),
              null,
              Arrays.<AbstractBuildParameters>asList(
                      new PredefinedBuildParameters("test=test")
              )
View Full Code Here

        createFreeStyleProject("project5");
        createFreeStyleProject("project6");

        Project<?, ?> triggerProject = createFreeStyleProject("projectA");

        TriggerBuilder triggerBuilder = new TriggerBuilder(createTriggerConfig("project1"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project2"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project3"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project4"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project5"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project6"));

        triggerProject.getBuildersList().add(triggerBuilder);

        triggerProject.scheduleBuild2(0).get();
View Full Code Here

        createFreeStyleProject("projectZ5");
        createFreeStyleProject("projectZ6");

        Project<?, ?> triggerProject = createFreeStyleProject("projectA");

        TriggerBuilder triggerBuilder = new TriggerBuilder(createTriggerConfig("project1"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project2"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project3"));

        TriggerBuilder triggerBuilder2 = new TriggerBuilder(createTriggerConfig("projectZ4"));
        triggerBuilder2.getConfigs().add(createTriggerConfig("projectZ5"));
        triggerBuilder2.getConfigs().add(createTriggerConfig("projectZ6"));

        p1.getBuildersList().add(triggerBuilder2);
        triggerProject.getBuildersList().add(triggerBuilder);

        triggerProject.scheduleBuild2(0).get();
View Full Code Here

        createFreeStyleProject("project2");
        createFreeStyleProject("project3");

        Project<?, ?> triggerProject = createFreeStyleProject("projectA");

        TriggerBuilder triggerBuilder = new TriggerBuilder(createTriggerConfig("project1, project2, project3"));

        triggerProject.getBuildersList().add(triggerBuilder);

        triggerProject.scheduleBuild2(0).get();
View Full Code Here

        createFreeStyleProject("project3");

        Project<?, ?> triggerProject = createFreeStyleProject("projectA");

        BlockableBuildTriggerConfig config = new BlockableBuildTriggerConfig("project1, project2, project3", null, null);
        TriggerBuilder triggerBuilder = new TriggerBuilder(config);

        triggerProject.getBuildersList().add(triggerBuilder);

        triggerProject.scheduleBuild2(0).get();
View Full Code Here

        ImmutableList<AbstractBuildParameterFactory> buildParameter = ImmutableList.<AbstractBuildParameterFactory>of(new CounterBuildParameterFactory("0","2","1", "TEST=COUNT$COUNT"));
        List<AbstractBuildParameters> emptyList = Collections.<AbstractBuildParameters>emptyList();

        BlockableBuildTriggerConfig bBTConfig = new BlockableBuildTriggerConfig("project1, project2, project3", blockingBehaviour, buildParameter, emptyList);

        triggerProject.getBuildersList().add(new TriggerBuilder(bBTConfig));

        triggerProject.scheduleBuild2(0).get();

        assertLines(triggerProject.getLastBuild(),
                "project1 #1 completed. Result was SUCCESS",
View Full Code Here

        p2.disable();
        createFreeStyleProject("project3");

        Project<?, ?> triggerProject = createFreeStyleProject("projectA");

        TriggerBuilder triggerBuilder = new TriggerBuilder(createTriggerConfig("project1, project2, project3"));

        triggerProject.getBuildersList().add(triggerBuilder);

        triggerProject.scheduleBuild2(0).get();
View Full Code Here

        createFreeStyleProject("project5");
        createFreeStyleProject("project6");

        MatrixProject matrixProject = createMatrixProject("matrixProject");

        TriggerBuilder triggerBuilder = new TriggerBuilder(createTriggerConfig("project1"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project2"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project3"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project4"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project5"));
        triggerBuilder.getConfigs().add(createTriggerConfig("project6"));

        matrixProject.getBuildersList().add(triggerBuilder);

        matrixProject.scheduleBuild2(0).get();
View Full Code Here

        project1.addProperty(promote);
       
        // promotion process to trigger project3
        PromotionProcess pp = promote.addProcess("TRIGGER");
        pp.conditions.add(new DownstreamPassCondition(project2.getName()));
        pp.getBuildSteps().add(new TriggerBuilder(createTriggerConfig(project3.getName())));
        // When using built-in BuildTrigger, set up as following:
        //pp.getBuildSteps().add(new hudson.tasks.BuildTrigger(project3.getName(), "SUCCESS"));
       
        // Are there any other ways to enable a new BuildTrigger?
        Jenkins.getInstance().rebuildDependencyGraph();
View Full Code Here

TOP

Related Classes of hudson.plugins.parameterizedtrigger.TriggerBuilder

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.