public Pipeline schedulePipeline( PipelineConfig pipelineConfig, BuildCause buildCause, String approvedBy, final Clock clock) { Pipeline pipeline = instanceFactory.createPipelineInstance( pipelineConfig, buildCause, new DefaultSchedulingContext(approvedBy), md5, clock); return scheduleJobInstancesAndSavePipeline(pipeline); }
public Pipeline checkinRevisionsToBuild( ManualBuild build, PipelineConfig pipelineConfig, List<MaterialRevision> revisions) { return pipelineService.save( instanceFactory.createPipelineInstance( pipelineConfig, build.onModifications(new MaterialRevisions(revisions), false, null), new DefaultSchedulingContext(), "md5-test", new TimeProvider())); }
private Pipeline scheduleWithFileChanges(PipelineConfig pipelineConfig) { BuildCause buildCause = BuildCause.createWithModifications(modifyOneFile(pipelineConfig), ""); saveRevs(buildCause.getMaterialRevisions()); return instanceFactory.createPipelineInstance( pipelineConfig, buildCause, new DefaultSchedulingContext(GoConstants.DEFAULT_APPROVED_BY), md5, new TimeProvider()); }
public Pipeline newPipelineWithFirstStageScheduled(PipelineConfig config) throws SQLException { Pipeline pipeline = instanceFactory.createPipelineInstance( config, BuildCause.createManualForced( modifyOneFile( MaterialsMother.createMaterialsFromMaterialConfigs(config.materialConfigs()), ModificationsMother.nextRevision()), Username.ANONYMOUS), new DefaultSchedulingContext(GoConstants.DEFAULT_APPROVED_BY), md5, new TimeProvider()); savePipelineWithStagesAndMaterials(pipeline); return pipeline; }
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); }
public Pipeline rescheduleTestPipeline(String pipelineName, String stageName, String userName) throws SQLException { String[] jobConfigNames = new String[] {}; PipelineConfig pipelineConfig = configurePipeline(pipelineName, stageName, jobConfigNames); BuildCause buildCause = BuildCause.createManualForced( modifyOneFile( MaterialsMother.createMaterialsFromMaterialConfigs( pipelineConfig.materialConfigs()), ModificationsMother.currentRevision()), Username.ANONYMOUS); Pipeline pipeline = instanceFactory.createPipelineInstance( pipelineConfig, buildCause, new DefaultSchedulingContext(GoConstants.DEFAULT_APPROVED_BY), md5, new TimeProvider()); return savePipelineWithStagesAndMaterials(pipeline); }