@Override public void addToTop(PipelineConfig pipelineConfig) { this.add(0, pipelineConfig); }
public BasicPipelineConfigs toBasicPipelineConfigs(Map.Entry<String, List<CRPipeline>> crPipelineGroup, PartialConfigLoadContext context) { String name = crPipelineGroup.getKey(); BasicPipelineConfigs pipelineConfigs = new BasicPipelineConfigs(); pipelineConfigs.setGroup(name); for (CRPipeline crPipeline : crPipelineGroup.getValue()) { pipelineConfigs.add(toPipelineConfig(crPipeline, context)); } return pipelineConfigs; }
@Override public PipelineConfigs getCopyForEditing() { BasicPipelineConfigs clone = (BasicPipelineConfigs) clone(); clone.clear(); for (PipelineConfig pipeline : this) { clone.add(pipeline.getCopyForEditing()); } return clone; }
@Test public void shouldKnowWhenBuildPlanNotInConfigFile() { pipelines.add(createPipelineConfig("pipeline", "stage", "build1", "build2")); assertThat(cruiseConfig.hasBuildPlan(new CaseInsensitiveString("pipeline"), new CaseInsensitiveString("stage"), "build1", true), is(true)); assertThat(cruiseConfig.hasBuildPlan(new CaseInsensitiveString("pipeline"), new CaseInsensitiveString("stage"), "build2", true), is(true)); assertThat(cruiseConfig.hasBuildPlan(new CaseInsensitiveString("pipeline"), new CaseInsensitiveString("stage"), "build3", true), is(false)); }
private PipelineConfig addPipeline(String pipelineName, String stageName, JobConfig... jobConfigs) { PipelineConfig pipeline = new PipelineConfig(new CaseInsensitiveString(pipelineName), new MaterialConfigs()); pipeline.add(new StageConfig(new CaseInsensitiveString(stageName), new JobConfigs(jobConfigs))); pipelines.add(pipeline); return pipeline; }
private void addPipelineWithStages(String pipelineName, String stageName, JobConfig... jobConfigs) { PipelineConfig pipeline = new PipelineConfig(new CaseInsensitiveString(pipelineName), null); pipeline.add(new StageConfig(new CaseInsensitiveString(stageName), new JobConfigs(jobConfigs))); pipeline.add(new StageConfig(new CaseInsensitiveString(stageName + "2"), new JobConfigs(jobConfigs))); pipelines.add(pipeline); }