Example #1
0
 @Deprecated // Only actually passes the first stage. Use newPipelineWithAllStagesPassed instead
 public Pipeline passPipeline(Pipeline pipeline) {
   for (Stage stage : pipeline.getStages()) {
     passStage(stage);
   }
   Stages loadedStages = new Stages();
   for (Stage stage : pipeline.getStages()) {
     loadedStages.add(stageDao.stageById(stage.getId()));
   }
   Pipeline loadedPipeline = this.pipelineDao.loadPipeline(pipeline.getId());
   loadedPipeline.setStages(loadedStages);
   return loadedPipeline;
 }
Example #2
0
 public Pipeline schedulePipelineWithAllStages(
     PipelineConfig pipelineConfig, BuildCause buildCause) {
   buildCause.assertMaterialsMatch(pipelineConfig.materialConfigs());
   DefaultSchedulingContext defaultSchedulingContext =
       new DefaultSchedulingContext(GoConstants.DEFAULT_APPROVED_BY);
   Stages stages = new Stages();
   Pipeline pipeline =
       instanceFactory.createPipelineInstance(
           pipelineConfig, buildCause, defaultSchedulingContext, md5, new TimeProvider());
   for (StageConfig stageConfig : pipelineConfig) {
     stages.add(
         instanceFactory.createStageInstance(
             stageConfig, defaultSchedulingContext, md5, new TimeProvider()));
   }
   pipeline.setStages(stages);
   return scheduleJobInstancesAndSavePipeline(pipeline);
 }