use of com.thoughtworks.go.domain.packagerepository.PackageDefinition in project gocd by gocd.
the class PackageDefinitionCreator method createNewPackageDefinition.
public PackageDefinition createNewPackageDefinition(CruiseConfig cruiseConfig) {
Map packageDefinitionMap = (Map) params.get(PACKAGE_DEFINITION);
String repositoryId = (String) packageDefinitionMap.get(REPOSITORY_ID);
PackageRepository packageRepository = cruiseConfig.getPackageRepositories().find(repositoryId);
PackageDefinition packageDefinition = new PackageDefinition();
packageDefinition.setRepository(packageRepository);
packageDefinition.setConfigAttributes(packageDefinitionMap);
if (packageRepository != null) {
validatePackageDefinition(packageDefinition);
cruiseConfig.savePackageDefinition(packageDefinition);
}
return packageDefinition;
}
use of com.thoughtworks.go.domain.packagerepository.PackageDefinition in project gocd by gocd.
the class PackageMaterialAddWithExistingPackageDefinitionCommand method updateConfig.
@Override
protected void updateConfig(CruiseConfig cruiseConfig) {
PackageDefinition packageDefinition = getPackageDefinition(cruiseConfig);
packageMaterialConfig.setPackageDefinition(packageDefinition);
PipelineConfig pipelineConfig = cruiseConfig.pipelineConfigByName(new CaseInsensitiveString(pipeline));
pipelineConfig.addMaterialConfig(packageMaterialConfig);
}
use of com.thoughtworks.go.domain.packagerepository.PackageDefinition in project gocd by gocd.
the class PackageMaterialAddWithNewPackageDefinitionCommand method updateConfig.
@Override
protected void updateConfig(CruiseConfig cruiseConfig) {
PackageDefinition packageDefinition = createNewPackageDefinition(cruiseConfig);
packageMaterialConfig.setPackageDefinition(packageDefinition);
PipelineConfig pipelineConfig = cruiseConfig.pipelineConfigByName(new CaseInsensitiveString(pipeline));
pipelineConfig.addMaterialConfig(packageMaterialConfig);
}
use of com.thoughtworks.go.domain.packagerepository.PackageDefinition in project gocd by gocd.
the class PackageMaterialUpdateWithExistingPackageDefinitionCommand method updateConfig.
@Override
protected void updateConfig(CruiseConfig cruiseConfig) {
PackageDefinition packageDefinition = getPackageDefinition(cruiseConfig);
packageMaterialConfig = (PackageMaterialConfig) cruiseConfig.pipelineConfigByName(new CaseInsensitiveString(pipeline)).materialConfigs().get(packageMaterialConfig);
packageMaterialConfig.setPackageDefinition(packageDefinition);
}
use of com.thoughtworks.go.domain.packagerepository.PackageDefinition in project gocd by gocd.
the class PackageMaterialUpdateWithNewPackageDefinitionCommand method updateConfig.
@Override
protected void updateConfig(CruiseConfig cruiseConfig) {
PackageDefinition packageDefinition = createNewPackageDefinition(cruiseConfig);
packageMaterialConfig = (PackageMaterialConfig) cruiseConfig.pipelineConfigByName(new CaseInsensitiveString(pipeline)).materialConfigs().get(packageMaterialConfig);
packageMaterialConfig.setPackageDefinition(packageDefinition);
}
Aggregations