use of com.thoughtworks.go.domain.DefaultSchedulingContext in project gocd by gocd.
the class PipelineWithRunOnAllJob method scheduleAndCompleteFollowingStages.
protected void scheduleAndCompleteFollowingStages(Pipeline pipeline, JobResult result) {
Stage ft = new InstanceFactory().createStageInstance(ftStage(), new DefaultSchedulingContext("anyone"), "md5-test", new TimeProvider());
ft.setOrderId(pipeline.getFirstStage().getOrderId() + 1);
dbHelper.getStageDao().saveWithJobs(pipeline, ft);
dbHelper.completeStage(ft, result);
}
use of com.thoughtworks.go.domain.DefaultSchedulingContext in project gocd by gocd.
the class JobAgentMetadataSqlMapDaoIntegrationTest method setup.
@BeforeEach
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();
}
use of com.thoughtworks.go.domain.DefaultSchedulingContext in project gocd by gocd.
the class BuildCauseProducerServiceWithFlipModificationTest method consume.
private void consume(final BuildCause buildCause) throws SQLException {
dbHelper.saveRevs(buildCause.getMaterialRevisions());
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
Pipeline latestPipeline = pipelineScheduleQueue.createPipeline(buildCause, mingleConfig, new DefaultSchedulingContext(buildCause.getApprover(), new Agents()), "md5", new TimeProvider());
// Pipeline latestPipeline = PipelineMother.schedule(mingleConfig, buildCause);
pipelineDao.saveWithStages(latestPipeline);
dbHelper.passStage(latestPipeline.getStages().first());
}
});
}
use of com.thoughtworks.go.domain.DefaultSchedulingContext in project gocd by gocd.
the class PipelineWithMultipleStages method scheduleAndCompleteFollowingStages.
@Override
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);
}
}
Aggregations