use of com.thoughtworks.go.domain.PipelineGroups in project gocd by gocd.
the class PartialConfigMother method withPipelineInGroup.
public static PartialConfig withPipelineInGroup(String pipelineName, String groupName) {
PipelineConfig pipe = PipelineConfigMother.pipelineConfig(pipelineName);
BasicPipelineConfigs pipes = new BasicPipelineConfigs(groupName, new Authorization(), pipe);
PartialConfig partialConfig = new PartialConfig(new PipelineGroups(pipes));
partialConfig.setOrigins(createRepoOrigin());
return partialConfig;
}
use of com.thoughtworks.go.domain.PipelineGroups in project gocd by gocd.
the class PartialConfigMother method withPipelineAssociatedWithTemplate.
public static PartialConfig withPipelineAssociatedWithTemplate(String name, String templateName, RepoConfigOrigin repoConfigOrigin) {
PipelineConfig pipeline = PipelineConfigMother.pipelineConfigWithTemplate(name, templateName);
BasicPipelineConfigs pipelineConfigs = new BasicPipelineConfigs(pipeline);
pipelineConfigs.setGroup("group");
PartialConfig partialConfig = new PartialConfig(new PipelineGroups(pipelineConfigs));
partialConfig.setOrigins(repoConfigOrigin);
return partialConfig;
}
use of com.thoughtworks.go.domain.PipelineGroups in project gocd by gocd.
the class PartialConfigMother method withPipelineMultipleMaterials.
public static PartialConfig withPipelineMultipleMaterials(String name, RepoConfigOrigin repoOrigin) {
GitMaterialConfig gitMaterialConfig = MaterialConfigsMother.gitMaterialConfig();
gitMaterialConfig.setFolder("git");
SvnMaterialConfig svnMaterialConfig = MaterialConfigsMother.svnMaterialConfig();
svnMaterialConfig.setFolder("svn");
PipelineConfig pipe = PipelineConfigMother.pipelineConfig(name, new MaterialConfigs(gitMaterialConfig, svnMaterialConfig));
BasicPipelineConfigs pipes = new BasicPipelineConfigs(pipe);
pipes.setGroup("group");
PartialConfig partialConfig = new PartialConfig(new PipelineGroups(pipes));
partialConfig.setOrigins(repoOrigin);
return partialConfig;
}
use of com.thoughtworks.go.domain.PipelineGroups in project gocd by gocd.
the class PartialConfigMother method withPipeline.
public static PartialConfig withPipeline(String name, RepoConfigOrigin repoOrigin) {
PipelineConfig pipe = PipelineConfigMother.pipelineConfig(name);
BasicPipelineConfigs pipes = new BasicPipelineConfigs(pipe);
pipes.setGroup("group");
PartialConfig partialConfig = new PartialConfig(new PipelineGroups(pipes));
partialConfig.setOrigins(repoOrigin);
return partialConfig;
}
use of com.thoughtworks.go.domain.PipelineGroups in project gocd by gocd.
the class PipelineHistoryService method allPipelineInstances.
private PipelineGroupModels allPipelineInstances(Username username) {
CruiseConfig currentConfig = goConfigService.currentCruiseConfig();
PipelineGroups groups = currentConfig.getGroups();
PipelineInstanceModels activePipelines = filterPermissions(pipelineDao.loadActivePipelines(), username);
PipelineGroupModels groupModels = new PipelineGroupModels();
for (PipelineConfig pipelineConfig : currentConfig.getAllPipelineConfigs()) {
CaseInsensitiveString pipelineName = pipelineConfig.name();
for (PipelineInstanceModel activePipeline : activePipelines.findAll(CaseInsensitiveString.str(pipelineName))) {
activePipeline.setTrackingTool(pipelineConfig.getTrackingTool());
activePipeline.setMingleConfig(pipelineConfig.getMingleConfig());
populatePlaceHolderStages(activePipeline);
String groupName = groups.findGroupNameByPipeline(pipelineName);
if (groupName == null) {
throw new RuntimeException("Unable to find group find pipeline " + pipelineName);
}
populatePreviousStageState(activePipeline);
populateLockStatus(activePipeline.getName(), username, activePipeline);
boolean canForce = schedulingCheckerService.canManuallyTrigger(CaseInsensitiveString.str(pipelineName), username);
PipelinePauseInfo pauseInfo = pipelinePauseService.pipelinePauseInfo(CaseInsensitiveString.str(pipelineName));
groupModels.addPipelineInstance(groupName, activePipeline, canForce, securityService.hasOperatePermissionForPipeline(username.getUsername(), CaseInsensitiveString.str(pipelineName)), pauseInfo);
}
}
for (PipelineConfigs group : groups) {
populateMissingPipelines(username, groupModels, group);
}
return groupModels;
}
Aggregations