Search in sources :

Example 36 with PluggableSCMMaterialConfig

use of com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig in project gocd by gocd.

the class BasicCruiseConfig method getAllUniquePostCommitSchedulableMaterials.

@Override
public Set<MaterialConfig> getAllUniquePostCommitSchedulableMaterials() {
    Set<MaterialConfig> materialConfigs = new HashSet<>();
    Set<String> uniqueMaterials = new HashSet<>();
    for (PipelineConfigs pipelineConfigs : this.groups) {
        for (PipelineConfig pipelineConfig : pipelineConfigs) {
            for (MaterialConfig materialConfig : pipelineConfig.materialConfigs()) {
                if ((materialConfig instanceof ScmMaterialConfig || materialConfig instanceof PluggableSCMMaterialConfig) && !materialConfig.isAutoUpdate() && !uniqueMaterials.contains(materialConfig.getFingerprint())) {
                    materialConfigs.add(materialConfig);
                    uniqueMaterials.add(materialConfig.getFingerprint());
                }
            }
        }
    }
    for (ConfigRepoConfig configRepo : this.configRepos) {
        MaterialConfig materialConfig = configRepo.getRepo();
        if (!materialConfig.isAutoUpdate() && !uniqueMaterials.contains(materialConfig.getFingerprint())) {
            materialConfigs.add(materialConfig);
            uniqueMaterials.add(materialConfig.getFingerprint());
        }
    }
    return materialConfigs;
}
Also used : PluggableSCMMaterialConfig(com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig) MaterialConfig(com.thoughtworks.go.domain.materials.MaterialConfig) DependencyMaterialConfig(com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig) ScmMaterialConfig(com.thoughtworks.go.config.materials.ScmMaterialConfig) MergePipelineConfigs(com.thoughtworks.go.config.merge.MergePipelineConfigs) ScmMaterialConfig(com.thoughtworks.go.config.materials.ScmMaterialConfig) PluggableSCMMaterialConfig(com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig)

Aggregations

PluggableSCMMaterialConfig (com.thoughtworks.go.config.materials.PluggableSCMMaterialConfig)36 Test (org.junit.jupiter.api.Test)25 SCM (com.thoughtworks.go.domain.scm.SCM)14 SCMs (com.thoughtworks.go.domain.scm.SCMs)11 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)9 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)8 MaterialConfig (com.thoughtworks.go.domain.materials.MaterialConfig)7 PackageMaterialConfig (com.thoughtworks.go.config.materials.PackageMaterialConfig)6 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)6 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)5 P4MaterialConfig (com.thoughtworks.go.config.materials.perforce.P4MaterialConfig)5 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)4 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)4 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)4 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)4 GoConfigHolder (com.thoughtworks.go.config.GoConfigHolder)3 ScmMaterialConfig (com.thoughtworks.go.config.materials.ScmMaterialConfig)3 TfsMaterialConfig (com.thoughtworks.go.config.materials.tfs.TfsMaterialConfig)3 ErrorGetter (com.thoughtworks.go.api.representers.ErrorGetter)2 Filter (com.thoughtworks.go.config.materials.Filter)2