Interface ConfigGenerator
-
- All Known Implementing Classes:
ConfigGeneratorAdapter
public interface ConfigGenerator
TeamCity configs generator. Can be used to update TeamCity configs on disk. Implementations should extendConfigGeneratorAdapter
instead of this interface.- See Also:
ConfigFilesUpdater
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canGenerate(String relativePath)
Returns true if generator can generate file with the given path relative to project directory.String
getDescription()
Returns generator description which can be used e.g.Logger
getExtraLogger()
Returns a logger to be used during configs update in addition to a logger writing into teamcity-server.log or null if log messages should be written to teamcity-server.log onlyFile
getGenerationDir()
Returns directory where configs will be generated or null if directory should be created by the updater.boolean
run(File tmpProjectsDir, Set<String> removedProjectExtIds)
Should generate projects in the given empty temporary projects dir and add external ids of the removed projects to the given set.
-
-
-
Method Detail
-
run
boolean run(@NotNull File tmpProjectsDir, @NotNull Set<String> removedProjectExtIds) throws ConfigGenerationException
Should generate projects in the given empty temporary projects dir and add external ids of the removed projects to the given set. Files hierarchy should be the same as in TEAMCITY_DATA_DIR/config/projects, i.e. it should contain folder for each updated project.- Parameters:
tmpProjectsDir
- temporary projects dirremovedProjectExtIds
- accumulator of project ids for removal- Returns:
- true of configs on server should be updated, false if update should not be performed
- Throws:
ConfigGenerationException
- in case of any errors, if this error is thrown no changes will be made to TeamCity config files will
-
getDescription
@NotNull String getDescription()
Returns generator description which can be used e.g. in the logs- Returns:
- see above
-
getExtraLogger
@Nullable Logger getExtraLogger()
Returns a logger to be used during configs update in addition to a logger writing into teamcity-server.log or null if log messages should be written to teamcity-server.log only- Returns:
- see above
-
canGenerate
boolean canGenerate(@NotNull String relativePath)
Returns true if generator can generate file with the given path relative to project directory. ConfigFilesUpdater assumes that any generator can generate well-known configs: project, build configuration/template, VCS root configs and plugin settings. Updater backs up these files and restores them in case of an update failure. Generator can expand the set of these files by returning true for some file from this method. Only well-known files and files where canGenerate() returns true will be updated in project config directory, other files will be ignored.- Parameters:
relativePath
- path relative to project config dir- Returns:
- see above
-
getGenerationDir
@Nullable File getGenerationDir()
Returns directory where configs will be generated or null if directory should be created by the updater.- Returns:
- see above
-
-