use of com.thoughtworks.go.config.StageConfig in project gocd by gocd.
the class PipelineWithMultipleStages method scheduleAndCompleteFollowingStages.
protected void scheduleAndCompleteFollowingStages(Pipeline pipeline, JobResult result) {
for (int index = 2; index <= stagesSize; index++) {
StageConfig stageConfig = stageConfig(index);
Stage instance = new InstanceFactory().createStageInstance(stageConfig, new DefaultSchedulingContext("anyone"), "md5-test", new TimeProvider());
instance.setOrderId(index);
dbHelper.getStageDao().saveWithJobs(pipeline, instance);
dbHelper.completeStage(instance, result);
}
}
use of com.thoughtworks.go.config.StageConfig in project gocd by gocd.
the class PipelineWithMultipleStages method moveStageToEnd.
public void moveStageToEnd(String stageName) {
StageConfig config = configHelper.removeStage(pipelineName, stageName);
configHelper.addStageToPipeline(pipelineName, config);
}
use of com.thoughtworks.go.config.StageConfig in project gocd by gocd.
the class PipelineMother method withTwoStagesOneBuildEach.
public static PipelineConfig withTwoStagesOneBuildEach(String pipelineName, String stageName, String stageName2) {
StageConfig stageConfig1 = com.thoughtworks.go.helper.StageConfigMother.oneBuildPlanWithResourcesAndMaterials(stageName);
StageConfig stageConfig2 = com.thoughtworks.go.helper.StageConfigMother.oneBuildPlanWithResourcesAndMaterials(stageName2);
MaterialConfigs materialConfigs = MaterialConfigsMother.defaultMaterialConfigs();
return new PipelineConfig(new CaseInsensitiveString(pipelineName), materialConfigs, stageConfig1, stageConfig2);
}
use of com.thoughtworks.go.config.StageConfig in project gocd by gocd.
the class StageMother method completedStageInstanceWithTwoPlans.
public static Stage completedStageInstanceWithTwoPlans(String stageName) {
StageConfig scheduledStageConfig = StageConfigMother.twoBuildPlansWithResourcesAndMaterials(stageName);
Stage completed = scheduleInstance(scheduledStageConfig);
passBuildInstancesOfStage(completed, new Date());
return completed;
}
use of com.thoughtworks.go.config.StageConfig in project gocd by gocd.
the class StageMother method scheduledStage.
public static Stage scheduledStage(String pipelineName, int pipelineCounter, String stageName, int stageCounter, String buildName) {
StageConfig stageConfig = StageConfigMother.oneBuildPlanWithResourcesAndMaterials(stageName, buildName);
Stage stage = scheduleInstance(stageConfig);
stage.setCounter(stageCounter);
stage.setIdentifier(new StageIdentifier(pipelineName, pipelineCounter, "LABEL-" + pipelineCounter, stageName, "" + stageCounter));
stage.setId(fakeId());
for (JobInstance jobInstance : stage.getJobInstances()) {
jobInstance.setIdentifier(new JobIdentifier(pipelineName, pipelineCounter, "LABEL-" + pipelineCounter, stageName, "" + stageCounter, buildName, fakeId()));
}
return stage;
}
Aggregations