Search in sources :

Example 6 with PipelineGroups

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;
}
Also used : PipelineGroups(com.thoughtworks.go.domain.PipelineGroups) PartialConfig(com.thoughtworks.go.config.remote.PartialConfig)

Example 7 with PipelineGroups

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;
}
Also used : PipelineGroups(com.thoughtworks.go.domain.PipelineGroups) PartialConfig(com.thoughtworks.go.config.remote.PartialConfig)

Example 8 with PipelineGroups

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;
}
Also used : PipelineGroups(com.thoughtworks.go.domain.PipelineGroups) MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) GitMaterialConfig(com.thoughtworks.go.config.materials.git.GitMaterialConfig) PartialConfig(com.thoughtworks.go.config.remote.PartialConfig) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)

Example 9 with PipelineGroups

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;
}
Also used : PipelineGroups(com.thoughtworks.go.domain.PipelineGroups) PartialConfig(com.thoughtworks.go.config.remote.PartialConfig)

Example 10 with PipelineGroups

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;
}
Also used : PipelineGroups(com.thoughtworks.go.domain.PipelineGroups) PipelinePauseInfo(com.thoughtworks.go.domain.PipelinePauseInfo)

Aggregations

PipelineGroups (com.thoughtworks.go.domain.PipelineGroups)15 PartialConfig (com.thoughtworks.go.config.remote.PartialConfig)7 Test (org.junit.Test)7 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)2 Username (com.thoughtworks.go.server.domain.Username)2 BasicPipelineConfigs (com.thoughtworks.go.config.BasicPipelineConfigs)1 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)1 PipelineConfigs (com.thoughtworks.go.config.PipelineConfigs)1 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)1 ScmMaterial (com.thoughtworks.go.config.materials.ScmMaterial)1 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)1 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)1 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)1 PipelinePauseInfo (com.thoughtworks.go.domain.PipelinePauseInfo)1 Material (com.thoughtworks.go.domain.materials.Material)1 GoConfigMother (com.thoughtworks.go.helper.GoConfigMother)1 PostCommitHookImplementer (com.thoughtworks.go.server.materials.postcommit.PostCommitHookImplementer)1 PostCommitHookMaterialType (com.thoughtworks.go.server.materials.postcommit.PostCommitHookMaterialType)1 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)1 Before (org.junit.Before)1