Search in sources :

Example 16 with PartialConfig

use of com.thoughtworks.go.config.remote.PartialConfig in project gocd by gocd.

the class XmlPartialConfigProvider method load.

@Override
public PartialConfig load(File configRepoCheckoutDirectory, PartialConfigLoadContext context) {
    File[] allFiles = getFiles(configRepoCheckoutDirectory, context);
    // if context had changed files list then we could parse only new content
    PartialConfig[] allFragments = parseFiles(allFiles);
    PartialConfig partialConfig = new PartialConfig();
    collectFragments(allFragments, partialConfig);
    partialConfig.validatePart();
    return partialConfig;
}
Also used : PartialConfig(com.thoughtworks.go.config.remote.PartialConfig) File(java.io.File)

Example 17 with PartialConfig

use of com.thoughtworks.go.config.remote.PartialConfig in project gocd by gocd.

the class PartialConfigMother method withParams.

public static PartialConfig withParams(String name, String paramName, String paramValue, RepoConfigOrigin repoConfigOrigin) {
    StageConfig stageConfig = StageConfigMother.stageConfigWithParams("stage", paramName);
    PipelineConfig pipeline = PipelineConfigMother.pipelineConfig(name, stageConfig);
    pipeline.setParams(new ParamsConfig(new ParamConfig(paramName, paramValue)));
    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 18 with PartialConfig

use of com.thoughtworks.go.config.remote.PartialConfig in project gocd by gocd.

the class PartialConfigMother method withEnvironment.

public static PartialConfig withEnvironment(String name, RepoConfigOrigin repoConfigOrigin) {
    BasicEnvironmentConfig env = EnvironmentConfigMother.environment(name);
    PartialConfig partialConfig = new PartialConfig();
    partialConfig.getEnvironments().add(env);
    partialConfig.setOrigins(repoConfigOrigin);
    return partialConfig;
}
Also used : PartialConfig(com.thoughtworks.go.config.remote.PartialConfig)

Example 19 with PartialConfig

use of com.thoughtworks.go.config.remote.PartialConfig 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 20 with PartialConfig

use of com.thoughtworks.go.config.remote.PartialConfig 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)

Aggregations

PartialConfig (com.thoughtworks.go.config.remote.PartialConfig)70 Test (org.junit.Test)39 RepoConfigOrigin (com.thoughtworks.go.config.remote.RepoConfigOrigin)29 File (java.io.File)15 ConfigRepoConfig (com.thoughtworks.go.config.remote.ConfigRepoConfig)12 StringContains.containsString (org.hamcrest.core.StringContains.containsString)12 FullConfigUpdateCommand (com.thoughtworks.go.config.update.FullConfigUpdateCommand)10 IOException (java.io.IOException)8 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)8 ExpectedException (org.junit.rules.ExpectedException)8 GoConfigInvalidException (com.thoughtworks.go.config.exceptions.GoConfigInvalidException)7 PipelineGroups (com.thoughtworks.go.domain.PipelineGroups)7 GoConfigMother (com.thoughtworks.go.helper.GoConfigMother)7 Cloner (com.rits.cloning.Cloner)6 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)6 ScmMaterialConfig (com.thoughtworks.go.config.materials.ScmMaterialConfig)5 ConfigFileHasChangedException (com.thoughtworks.go.config.exceptions.ConfigFileHasChangedException)4 ConfigMergeException (com.thoughtworks.go.config.exceptions.ConfigMergeException)4 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)3 DependencyMaterialConfig (com.thoughtworks.go.config.materials.dependency.DependencyMaterialConfig)3