use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.
the class PipelineConfigServiceIntegrationTest method setup.
@BeforeEach
public void setup() throws Exception {
cachedGoPartials.clear();
configHelper = new GoConfigFileHelper();
dbHelper.onSetUp();
configHelper.usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
goConfigService.forceNotifyListeners();
user = new Username(new CaseInsensitiveString("current"));
pipelineConfig = GoConfigMother.createPipelineConfigWithMaterialConfig(UUID.randomUUID().toString(), git("FOO"));
goConfigService.addPipeline(pipelineConfig, groupName);
repoConfig1 = createConfigRepoWithDefaultRules(MaterialConfigsMother.gitMaterialConfig("url"), XmlPartialConfigProvider.providerName, "git-id1");
repoConfig2 = createConfigRepoWithDefaultRules(MaterialConfigsMother.gitMaterialConfig("url2"), XmlPartialConfigProvider.providerName, "git-id2");
goConfigService.updateConfig(new UpdateConfigCommand() {
@Override
public CruiseConfig update(CruiseConfig cruiseConfig) throws Exception {
cruiseConfig.getConfigRepos().add(repoConfig1);
cruiseConfig.getConfigRepos().add(repoConfig2);
return cruiseConfig;
}
});
GoCipher goCipher = new GoCipher();
goConfigService.updateServerConfig(new MailHost(goCipher), goConfigService.configFileMd5(), "artifacts", null, null, "0", null, null, "foo");
UpdateConfigCommand command = goConfigService.modifyAdminPrivilegesCommand(asList(user.getUsername().toString()), new TriStateSelection(Admin.GO_SYSTEM_ADMIN, TriStateSelection.Action.add));
goConfigService.updateConfig(command);
remoteDownstreamPipelineName = "remote-downstream";
partialConfig = PartialConfigMother.pipelineWithDependencyMaterial(remoteDownstreamPipelineName, pipelineConfig, new RepoConfigOrigin(repoConfig1, "repo1_r1"));
partialConfigService.onSuccessPartialConfig(repoConfig1, partialConfig);
PartialConfig partialConfigFromRepo2 = PartialConfigMother.withPipeline("independent-pipeline", new RepoConfigOrigin(repoConfig2, "repo2_r1"));
partialConfigService.onSuccessPartialConfig(repoConfig2, partialConfigFromRepo2);
result = new HttpLocalizedOperationResult();
headCommitBeforeUpdate = configRepository.getCurrentRevCommit().name();
goConfigService.security().securityAuthConfigs().add(new SecurityAuthConfig("file", "cd.go.authentication.passwordfile"));
}
use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.
the class PipelineConfigsServiceIntegrationTest method setUp.
@BeforeEach
public void setUp() throws Exception {
configHelper = new GoConfigFileHelper();
xml = goConfigMigration.upgradeIfNecessary(IOUtils.toString(getClass().getResource("/data/config_with_pluggable_artifacts_store.xml"), UTF_8));
setupMetadataForPlugin();
configHelper.usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
configHelper.writeXmlToConfigFile(xml);
goConfigService.forceNotifyListeners();
}
use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.
the class ScheduleStageTest method setUp.
@BeforeEach
public void setUp(@TempDir Path tempDir) throws Exception {
configHelper = new GoConfigFileHelper().usingCruiseConfigDao(dao);
fixture = new PipelineWithMultipleStages(3, materialRepository, transactionTemplate, tempDir);
fixture.usingThreeJobs();
fixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
}
use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.
the class ScheduledPipelineLoaderIntegrationTest method setup.
@BeforeEach
public void setup(@TempDir Path tempDir) throws Exception {
configHelper = new GoConfigFileHelper(goConfigDao);
dbHelper.onSetUp();
goCache.clear();
configHelper.onSetUp();
svnRepo = new SvnTestRepoWithExternal(tempDir);
cleanupTempFolders();
}
use of com.thoughtworks.go.util.GoConfigFileHelper in project gocd by gocd.
the class ScheduleServiceIntegrationTest method setup.
@BeforeEach
public void setup(@TempDir Path tempDir) throws Exception {
configHelper = new GoConfigFileHelper();
dbHelper.onSetUp();
configHelper.usingCruiseConfigDao(goConfigDao);
configHelper.onSetUp();
pipelineFixture = new PipelineWithTwoStages(materialRepository, transactionTemplate, tempDir);
pipelineFixture.usingConfigHelper(configHelper).usingDbHelper(dbHelper).onSetUp();
repository = new SvnCommand(null, testRepo.projectRepositoryUrl());
mingleConfig = configHelper.addPipeline("mingle", STAGE_NAME, repository, JOB_NAME, "functional");
goConfigService.forceNotifyListeners();
agentAssignment.clear();
goCache.clear();
}
Aggregations