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 String
FORMAT
static String
YAML_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 void
ensureConfigCompatibility(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.ProjectSettingsGenerationResult
generate(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.String
getFormat()
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.String
getProjectScriptName()
Returns name of per-project root script or null if per-project script is not supportedString
getRootScriptName()
Returns name of the root script or null if root script is not supportedProjectSettingsPathsProvider
getSettingsPathsProvider()
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.boolean
isGenerateFullProject()
Returns true if generator is able to generate full project settings which can be committed to VCSboolean
isVisible()
Indicates whether this format should be hidden for users selection, e.g.void
writeProjectConfigs(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:ProjectSettingsGenerator
Returns format supported by this generator- Specified by:
getFormat
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
isVisible
public boolean isVisible()
Description copied from interface:ProjectSettingsGenerator
Indicates whether this format should be hidden for users selection, e.g. on the Versioned Setting Configuration page- Specified by:
isVisible
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
getSettingsPathsProvider
@NotNull public ProjectSettingsPathsProvider getSettingsPathsProvider()
Description copied from interface:ProjectSettingsGenerator
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 formats- Specified by:
getSettingsPathsProvider
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
getCommitFilePredicate
@NotNull public BiPredicate<String,File> getCommitFilePredicate()
Description copied from interface:ProjectSettingsGenerator
Returns 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:
getCommitFilePredicate
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
generate
@NotNull public ProjectSettingsGenerationResult generate(@NotNull VersionedSettingsFileSystem fs, @NotNull RawConfigsBuilder builder, @NotNull GenOptions options) throws ConfigGenerationException
- Specified by:
generate
in interfaceProjectSettingsGenerator
- Throws:
ConfigGenerationException
-
getBuildTypeConfigPaths
@NotNull public Set<String> getBuildTypeConfigPaths(@NotNull SBuildType buildType, @NotNull ProjectSettingsPaths projectSettingsPaths)
Description copied from interface:ProjectSettingsGenerator
Should 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:
getBuildTypeConfigPaths
in 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:ProjectSettingsGenerator
Should 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:
getTemplateConfigPaths
in 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:ProjectSettingsGenerator
Should 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:
getVcsRootConfigPaths
in 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:ProjectSettingsGenerator
Should 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:
getProjectConfigPaths
in 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:ProjectSettingsGenerator
Writes project settings of the given project to the specified dir- Specified by:
writeProjectConfigs
in 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:ProjectSettingsGenerator
Checks if this generator can produce settings for the given project. Fills theidsToSubstitute
map for entities where extId should be changed. Reports errors viaerrors
.Options
contains generator specific options which can affect how extIds are mapped to the names in produced settings.- Specified by:
ensureConfigCompatibility
in interfaceProjectSettingsGenerator
-
getProjectScriptName
@NotNull public String getProjectScriptName()
Description copied from interface:ProjectSettingsGenerator
Returns name of per-project root script or null if per-project script is not supported- Specified by:
getProjectScriptName
in interfaceProjectSettingsGenerator
-
getRootScriptName
@NotNull public String getRootScriptName()
Description copied from interface:ProjectSettingsGenerator
Returns name of the root script or null if root script is not supported- Specified by:
getRootScriptName
in interfaceProjectSettingsGenerator
-
isGenerateFullProject
public boolean isGenerateFullProject()
Description copied from interface:ProjectSettingsGenerator
Returns true if generator is able to generate full project settings which can be committed to VCS- Specified by:
isGenerateFullProject
in interfaceProjectSettingsGenerator
- Returns:
- see above
-
-