use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class DatabaseAccessHelper method saveTestPipelineWithoutSchedulingBuilds.
public Pipeline saveTestPipelineWithoutSchedulingBuilds(String pipelineName, String stageName, String... jobConfigNames) throws SQLException {
PipelineConfig pipelineConfig = configurePipeline(pipelineName, stageName, jobConfigNames);
Pipeline pipeline = scheduleWithFileChanges(pipelineConfig);
clearAllBuildInstances(pipeline);
return savePipelineWithStagesAndMaterials(pipeline);
}
use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class PackageMaterialAddWithExistingPackageDefinitionCommand method updateConfig.
@Override
protected void updateConfig(CruiseConfig cruiseConfig) {
PackageDefinition packageDefinition = getPackageDefinition(cruiseConfig);
packageMaterialConfig.setPackageDefinition(packageDefinition);
PipelineConfig pipelineConfig = cruiseConfig.pipelineConfigByName(new CaseInsensitiveString(pipeline));
pipelineConfig.addMaterialConfig(packageMaterialConfig);
}
use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class PackageMaterialAddWithNewPackageDefinitionCommand method updateConfig.
@Override
protected void updateConfig(CruiseConfig cruiseConfig) {
PackageDefinition packageDefinition = createNewPackageDefinition(cruiseConfig);
packageMaterialConfig.setPackageDefinition(packageDefinition);
PipelineConfig pipelineConfig = cruiseConfig.pipelineConfigByName(new CaseInsensitiveString(pipeline));
pipelineConfig.addMaterialConfig(packageMaterialConfig);
}
use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class PipelineTemplateConfigViewModelTest method shouldSetConfigAttributesBasedOnExistingPipeline.
@Test
public void shouldSetConfigAttributesBasedOnExistingPipeline() {
StageConfig stage1 = StageConfigMother.custom("stage_foo", "foo1", "foo2");
StageConfig stage2 = StageConfigMother.custom("stage_bar", "bar1", "bar2");
PipelineConfig pipeline = PipelineConfigMother.pipelineConfig("pipeline", stage1, stage2);
PipelineTemplateConfigViewModel viewModel = new PipelineTemplateConfigViewModel(new PipelineTemplateConfig(), "", Arrays.asList(PipelineConfigMother.pipelineConfig("foo_bar"), pipeline));
Map m = m("template", m(PipelineTemplateConfig.NAME, "template_name"), PipelineTemplateConfigViewModel.USE_EXISTING_PIPELINE, "1", PipelineTemplateConfigViewModel.SELECTED_PIPELINE_NAME, pipeline.name().toString());
viewModel.setConfigAttributes(m);
assertThat(viewModel.useExistingPipeline(), is(true));
assertThat(viewModel.selectedPipelineName(), is(pipeline.name().toString()));
PipelineTemplateConfig template = viewModel.templateConfig();
assertThat(template.name(), is(new CaseInsensitiveString("template_name")));
assertThat(template.size(), is(2));
assertThat(template.get(0), is(stage1));
assertThat(template.get(1), is(stage2));
}
use of com.thoughtworks.go.config.PipelineConfig in project gocd by gocd.
the class MingleConfigService method mingleConfigForPipelineNamed.
public MingleConfig mingleConfigForPipelineNamed(String pipelineName, Username user, HttpLocalizedOperationResult result) {
if (!securityService.hasViewPermissionForPipeline(user, pipelineName)) {
result.unauthorized(LocalizedMessage.cannotViewPipeline(pipelineName), HealthStateType.unauthorisedForPipeline(pipelineName));
return null;
}
PipelineConfig pipelineConfig = goConfigService.pipelineConfigNamed(new CaseInsensitiveString(pipelineName));
MingleConfig mingleConfig = pipelineConfig.getMingleConfig();
return mingleConfig.equals(new MingleConfig()) ? null : mingleConfig;
}
Aggregations