Class YamlPipelineSettingsGenerator
- java.lang.Object
-
- jetbrains.buildServer.pipeline.versionedSettings.yaml.YamlPipelineSettingsGenerator
-
- All Implemented Interfaces:
ProjectSettingsGenerator
@Component public class YamlPipelineSettingsGenerator extends Object implements ProjectSettingsGenerator
-
-
Field Summary
Fields Modifier and Type Field Description static StringFORMATstatic StringYAML_FILE_IN_VCS-
Fields inherited from interface jetbrains.buildServer.serverSide.impl.versionedSettings.ProjectSettingsGenerator
ACCEPT_ALL
-
-
Constructor Summary
Constructors Constructor Description YamlPipelineSettingsGenerator(ProjectSettingsGeneratorRegistry settingsGeneratorRegistry, ProjectManager projectManager, VersionedSettingsManager versionedSettingsManager, YamlInProjectStorage yamlInProjectStorage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidensureConfigCompatibility(SProject project, List<String> errors, Map<String,Map<String,String>> idsToSubstitute, Map<String,String> options)Checks if this generator can produce settings for the given project.ProjectSettingsGenerationResultgenerate(VersionedSettingsFileSystem fs, RawConfigsBuilder builder, GenOptions options)Set<String>getBuildTypeConfigPaths(SBuildType buildType, ProjectSettingsPaths projectSettingsPaths)Should return paths to configs of the specified buildType from the root directory of the versioned settings VCS root.BiPredicate<String,File>getCommitFilePredicate()Returns predicate for file and its path relative to project root to be committed in VCS.StringgetFormat()Returns format supported by this generatorSet<String>getProjectConfigPaths(SProject project, ProjectSettingsPaths projectSettingsPaths)Should return paths to configs of the specified project from the root directory of the versioned settings VCS root.StringgetProjectScriptName()Returns name of per-project root script or null if per-project script is not supportedStringgetRootScriptName()Returns name of the root script or null if root script is not supportedProjectSettingsPathsProvidergetSettingsPathsProvider()Returns provider of the paths that are used to store Versioned Settings for the given format, e.g., logic related to ".teamcity" for the Kotlin / XML formatsSet<String>getTemplateConfigPaths(BuildTypeTemplate template, ProjectSettingsPaths projectSettingsPaths)Should return paths to configs of the specified template from the root directory of the versioned settings VCS root.Set<String>getVcsRootConfigPaths(SVcsRoot root, ProjectSettingsPaths projectSettingsPaths)Should return paths to configs of the specified VCS root from the root directory of the versioned settings VCS root.booleanisGenerateFullProject()Returns true if generator is able to generate full project settings which can be committed to VCSbooleanisVisible()Indicates whether this format should be hidden for users selection, e.g.voidwriteProjectConfigs(SProject project, File dstDir, ProjectSettingsGeneratorConfig config)Writes project settings of the given project to the specified dir-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.impl.versionedSettings.ProjectSettingsGenerator
generate, generate, generate, generate, getDocumentationUrl, getEditableSettingsNote, getFormatDisplayName, getReadOnlyReason, getVersions, getZipReadme, isCustomFormat, isExtIdChangeSupported, isMoveEntitiesSupported, isProjectCreateSupported, isProjectDeleteSupported, isProjectMoveSupported, isSupportProjectDirRemove, isSupportsRelativeIds, isSupportsRelativeIds, isUIEditingEnabled, isUIEditingSupported, isUseRelativeIds, isVersionedSettingsConfigStoredInVCS, isVersionedSettingsConfigUpdateSupported, isVersionedSettingsRootUpdateSupported
-
-
-
-
Field Detail
-
FORMAT
public static final String FORMAT
- See Also:
- Constant Field Values
-
YAML_FILE_IN_VCS
public static final String YAML_FILE_IN_VCS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
YamlPipelineSettingsGenerator
public YamlPipelineSettingsGenerator(@NotNull ProjectSettingsGeneratorRegistry settingsGeneratorRegistry, @NotNull ProjectManager projectManager, @NotNull VersionedSettingsManager versionedSettingsManager, @NotNull YamlInProjectStorage yamlInProjectStorage)
-
-
Method Detail
-
getFormat
@NotNull public String getFormat()
Description copied from interface:ProjectSettingsGeneratorReturns format supported by this generator- Specified by:
getFormatin interfaceProjectSettingsGenerator- Returns:
- see above
-
isVisible
public boolean isVisible()
Description copied from interface:ProjectSettingsGeneratorIndicates whether this format should be hidden for users selection, e.g. on the Versioned Setting Configuration page- Specified by:
isVisiblein interfaceProjectSettingsGenerator- Returns:
- see above
-
getSettingsPathsProvider
@NotNull public ProjectSettingsPathsProvider getSettingsPathsProvider()
Description copied from interface:ProjectSettingsGeneratorReturns provider of the paths that are used to store Versioned Settings for the given format, e.g., logic related to ".teamcity" for the Kotlin / XML formats- Specified by:
getSettingsPathsProviderin interfaceProjectSettingsGenerator- Returns:
- see above
-
getCommitFilePredicate
@NotNull public BiPredicate<String,File> getCommitFilePredicate()
Description copied from interface:ProjectSettingsGeneratorReturns predicate for file and its path relative to project root to be committed in VCS. If the predicate returns false, the file won't be committed.- Specified by:
getCommitFilePredicatein interfaceProjectSettingsGenerator- Returns:
- see above
-
generate
@NotNull public ProjectSettingsGenerationResult generate(@NotNull VersionedSettingsFileSystem fs, @NotNull RawConfigsBuilder builder, @NotNull GenOptions options) throws ConfigGenerationException
- Specified by:
generatein interfaceProjectSettingsGenerator- Throws:
ConfigGenerationException
-
getBuildTypeConfigPaths
@NotNull public Set<String> getBuildTypeConfigPaths(@NotNull SBuildType buildType, @NotNull ProjectSettingsPaths projectSettingsPaths)
Description copied from interface:ProjectSettingsGeneratorShould return paths to configs of the specified buildType from the root directory of the versioned settings VCS root. Should use '/' as a name separator- Specified by:
getBuildTypeConfigPathsin interfaceProjectSettingsGenerator- Parameters:
buildType- buildType of interestprojectSettingsPaths- custom project settings paths in VCS- Returns:
- see above
-
getTemplateConfigPaths
@NotNull public Set<String> getTemplateConfigPaths(@NotNull BuildTypeTemplate template, @NotNull ProjectSettingsPaths projectSettingsPaths)
Description copied from interface:ProjectSettingsGeneratorShould return paths to configs of the specified template from the root directory of the versioned settings VCS root. Should use '/' as a name separator- Specified by:
getTemplateConfigPathsin interfaceProjectSettingsGenerator- Parameters:
template- template of interestprojectSettingsPaths- custom project settings paths in VCS- Returns:
- see above
-
getVcsRootConfigPaths
@NotNull public Set<String> getVcsRootConfigPaths(@NotNull SVcsRoot root, @NotNull ProjectSettingsPaths projectSettingsPaths)
Description copied from interface:ProjectSettingsGeneratorShould return paths to configs of the specified VCS root from the root directory of the versioned settings VCS root. Should use '/' as a name separator- Specified by:
getVcsRootConfigPathsin interfaceProjectSettingsGenerator- Parameters:
root- VCS root of interestprojectSettingsPaths- custom project settings paths in VCS- Returns:
- see above
-
getProjectConfigPaths
@NotNull public Set<String> getProjectConfigPaths(@NotNull SProject project, @NotNull ProjectSettingsPaths projectSettingsPaths)
Description copied from interface:ProjectSettingsGeneratorShould return paths to configs of the specified project from the root directory of the versioned settings VCS root. Should use '/' as a name separator- Specified by:
getProjectConfigPathsin interfaceProjectSettingsGenerator- Parameters:
project- project of interestprojectSettingsPaths- custom project settings paths in VCS- Returns:
- see above
-
writeProjectConfigs
public void writeProjectConfigs(@NotNull SProject project, @NotNull File dstDir, @NotNull ProjectSettingsGeneratorConfig config)Description copied from interface:ProjectSettingsGeneratorWrites project settings of the given project to the specified dir- Specified by:
writeProjectConfigsin interfaceProjectSettingsGenerator- Parameters:
project- project of interestdstDir- destination dirconfig- options for settings generator
-
ensureConfigCompatibility
public void ensureConfigCompatibility(@NotNull SProject project, @NotNull List<String> errors, @NotNull Map<String,Map<String,String>> idsToSubstitute, @NotNull Map<String,String> options)Description copied from interface:ProjectSettingsGeneratorChecks if this generator can produce settings for the given project. Fills theidsToSubstitutemap for entities where extId should be changed. Reports errors viaerrors.Optionscontains generator specific options which can affect how extIds are mapped to the names in produced settings.- Specified by:
ensureConfigCompatibilityin interfaceProjectSettingsGenerator
-
getProjectScriptName
@NotNull public String getProjectScriptName()
Description copied from interface:ProjectSettingsGeneratorReturns name of per-project root script or null if per-project script is not supported- Specified by:
getProjectScriptNamein interfaceProjectSettingsGenerator
-
getRootScriptName
@NotNull public String getRootScriptName()
Description copied from interface:ProjectSettingsGeneratorReturns name of the root script or null if root script is not supported- Specified by:
getRootScriptNamein interfaceProjectSettingsGenerator
-
isGenerateFullProject
public boolean isGenerateFullProject()
Description copied from interface:ProjectSettingsGeneratorReturns true if generator is able to generate full project settings which can be committed to VCS- Specified by:
isGenerateFullProjectin interfaceProjectSettingsGenerator- Returns:
- see above
-
-