use of com.thoughtworks.go.util.TimeProvider in project gocd by gocd.
the class DatabaseAccessHelper method scheduleWithFileChanges.
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());
}
use of com.thoughtworks.go.util.TimeProvider in project gocd by gocd.
the class DatabaseAccessHelper method schedulePipelineWithAllStages.
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);
}
use of com.thoughtworks.go.util.TimeProvider in project gocd by gocd.
the class DatabaseAccessHelper method newPipelineWithFirstStagePassed.
public Pipeline newPipelineWithFirstStagePassed(PipelineConfig config) throws SQLException {
Pipeline pipeline = instanceFactory.createPipelineInstance(config, BuildCause.createManualForced(modifyOneFile(new MaterialConfigConverter().toMaterials(config.materialConfigs()), ModificationsMother.nextRevision()), Username.ANONYMOUS), new DefaultSchedulingContext(GoConstants.DEFAULT_APPROVED_BY), md5, new TimeProvider());
saveMaterialsWIthPassedStages(pipeline);
return pipeline;
}
use of com.thoughtworks.go.util.TimeProvider in project gocd by gocd.
the class DatabaseAccessHelper method newPipelineWithFirstStageScheduled.
public Pipeline newPipelineWithFirstStageScheduled(PipelineConfig config) throws SQLException {
Pipeline pipeline = instanceFactory.createPipelineInstance(config, BuildCause.createManualForced(modifyOneFile(new MaterialConfigConverter().toMaterials(config.materialConfigs()), ModificationsMother.nextRevision()), Username.ANONYMOUS), new DefaultSchedulingContext(GoConstants.DEFAULT_APPROVED_BY), md5, new TimeProvider());
savePipelineWithStagesAndMaterials(pipeline);
return pipeline;
}
use of com.thoughtworks.go.util.TimeProvider in project gocd by gocd.
the class JobAgentMetadataSqlMapDaoIntegrationTest method setup.
@Before
public void setup() throws Exception {
dbHelper.onSetUp();
PipelineConfig pipelineConfig = PipelineMother.withSingleStageWithMaterials(PIPELINE_NAME, STAGE_NAME, BuildPlanMother.withBuildPlans(JOB_NAME, OTHER_JOB_NAME));
DefaultSchedulingContext schedulingContext = new DefaultSchedulingContext(DEFAULT_APPROVED_BY);
Pipeline savedPipeline = instanceFactory.createPipelineInstance(pipelineConfig, modifySomeFiles(pipelineConfig), schedulingContext, "md5-test", new TimeProvider());
dbHelper.savePipelineWithStagesAndMaterials(savedPipeline);
Stage savedStage = savedPipeline.getFirstStage();
jobId = savedStage.getJobInstances().getByName(JOB_NAME).getId();
}
Aggregations