Package jetbrains.buildServer.serverSide
Interface BuildCustomizerEx
-
- All Superinterfaces:
BuildCustomizer
- All Known Implementing Classes:
BuildCustomizerImpl
public interface BuildCustomizerEx extends BuildCustomizer
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
BuildCustomizerEx.RebuildDependenciesMode
static class
BuildCustomizerEx.UpToModificationMode
static interface
BuildCustomizerEx.UpToModificationSelectionMode
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addParametersIfAbsent(List<Parameter> customParams)
Same asBuildCustomizer.addParametersIfAbsent(Map)
but acceptingParameter
instancesvoid
addSkippedDependencies(Collection<String> externalBuildTypeIds)
static BuildCustomizerEx.UpToModificationSelectionMode
auto()
Enables automatic detection of changes included in the build.static BuildCustomizerEx.UpToModificationSelectionMode
checkForChanges()
Changes will be collected before build started and the latest modifications will be used.Map<String,Parameter>
getCustomParameters()
String
getDesiredBranchName()
static BuildCustomizerEx.UpToModificationSelectionMode
selected(SVcsModification modification)
Selected modification will be used as maxModificationId for whole created chain.void
setAddToFavorites(boolean value)
Control whether build will be added to favorite or not Overrides StandardProperties.ADD_TRIGGERED_BUILD_TO_FAVORITESvoid
setApplyCleanSourcesToDependencies(boolean apply)
If apply is true, then applies clean sources configuration to all of the snapshot dependencies.void
setApplyTagsToDependencies(boolean value)
Marks if tags should be applied to all builds that this build snapshot depends onvoid
setBuildPromotionInitializer(Consumer<BuildPromotionEx> initializer)
Sets an initializer which accepts a newly created build promotion and does some initialization work there, for instance, it can set some specific settings.void
setDependenciesSupplier(DependenciesSupplier supplier)
Sets a custom dependencies supplier which should be used when a build promotion is created.void
setDesiredBranchName(String branchName, boolean defaultBranchFallback)
Sets the desired branch name for the build promotion (will be propagated to the whole snapshot dependency graph).void
setFreezeSettings(Boolean freezeSettings)
void
setNodeRevisions(String buildTypeId, long modId, long chainModId, Collection<BuildRevisionEx> revisions)
Sets revision information to node of the build chain which corresponds to specified build configuration internal idvoid
setParameters(List<Parameter> customParams)
Same assetParameters(List)
but acceptingParameter
instancesvoid
setPromotedBuild(SBuild build, Predicate<RevisionRule> artifDependencyRevisionPredicate)
Promotes build into dependencies of the build created by this build customizer.void
setProvidedUpperLimitRevisions(Map<Long,RepositoryVersion> upperLimitRevisions)
Sets upper limit revisions map as "provided" upper limit revisions: they will be used instead of the current revision during the checking for changes processvoid
setRebuildDependencies(BuildCustomizerEx.RebuildDependenciesMode mode)
Sets rebuild dependencies mode, seeBuildCustomizerEx.RebuildDependenciesMode
.void
setScheduledTime(ZonedDateTime date)
Allows to force the build to wait in the queue until some time in the futurevoid
setStickToRevisions(boolean stickToRevisions)
void
setUpToModificationSelectionMode(BuildCustomizerEx.UpToModificationSelectionMode upToModificationSelectionMode)
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildCustomizer
addParametersIfAbsent, addParametersIfAbsent, createPromotion, getBuildType, getCurrentUser, setArtifactDependencies, setAttributes, setBuildComment, setChangesUpTo, setCleanSources, setDesiredBranchName, setParameters, setPersonal, setPersonalChangeId, setRebuildDependencies, setRebuildDependencies, setSnapshotDependencyNodes, setTagDatas
-
-
-
-
Method Detail
-
setStickToRevisions
void setStickToRevisions(boolean stickToRevisions)
-
setApplyTagsToDependencies
void setApplyTagsToDependencies(boolean value)
Marks if tags should be applied to all builds that this build snapshot depends on- Since:
- 9.0
-
setApplyCleanSourcesToDependencies
void setApplyCleanSourcesToDependencies(boolean apply)
If apply is true, then applies clean sources configuration to all of the snapshot dependencies.- Since:
- 2017.1
-
setAddToFavorites
void setAddToFavorites(boolean value)
Control whether build will be added to favorite or not Overrides StandardProperties.ADD_TRIGGERED_BUILD_TO_FAVORITES- Since:
- 9.1
- See Also:
FavoriteBuildsManager
-
setPromotedBuild
void setPromotedBuild(@NotNull SBuild build, @NotNull Predicate<RevisionRule> artifDependencyRevisionPredicate) throws BuildTypeNotFoundException
Promotes build into dependencies of the build created by this build customizer. If there is a snapshot dependency on build configuration of provided build, then corresponding modification id will be calculated and set and snapshot dependencies will be modified. If there are artifact dependencies on build configuration of provided build (except the same chain dependencies, they will be left intact), then they will be modified to have direct dependencies on this build.- Parameters:
build
- build to promoteartifDependencyRevisionPredicate
- dependent build configuration can have many artifact dependencies with different rules pointing to the build configuration of promoted build; this predicate determines which revision rules must be changed to point at the promoted build.- Throws:
BuildTypeNotFoundException
- if build configuration of specified build cannot be found- Since:
- 9.1
-
setDesiredBranchName
void setDesiredBranchName(@NotNull String branchName, boolean defaultBranchFallback)
Sets the desired branch name for the build promotion (will be propagated to the whole snapshot dependency graph).- Parameters:
branchName
- the branch name - empty string means default branchdefaultBranchFallback
- true means that when display name of the default branch is passed, build in the default branch will be triggered. false just sets the branch name as passed- Since:
- 2019.2.1
-
getDesiredBranchName
@Nullable String getDesiredBranchName()
- Returns:
- the specified desired branch name, if any. Could be used by extensions to check if branch was set
- Since:
- 2022.06
-
setFreezeSettings
void setFreezeSettings(@Nullable Boolean freezeSettings)
- Since:
- 9.1
- See Also:
BuildPromotionEx.setFreezeSettings(Boolean)
-
setRebuildDependencies
void setRebuildDependencies(@NotNull BuildCustomizerEx.RebuildDependenciesMode mode)
Sets rebuild dependencies mode, seeBuildCustomizerEx.RebuildDependenciesMode
.- Parameters:
rebuildFailed
-- Since:
- 2018.1
-
setUpToModificationSelectionMode
void setUpToModificationSelectionMode(@NotNull BuildCustomizerEx.UpToModificationSelectionMode upToModificationSelectionMode)
-
addSkippedDependencies
void addSkippedDependencies(Collection<String> externalBuildTypeIds)
- Parameters:
externalBuildTypeIds
- for configurations which should be excluded/skipped in the build chain- Since:
- 2024.12
-
auto
static BuildCustomizerEx.UpToModificationSelectionMode auto()
Enables automatic detection of changes included in the build. Considers build dependencies settings: - all promotions reachable from added in setSnapshotDependencyNodes() will get one revision - promotion chains reachable only by soft build dependencies will be handled separately Resets setChangesUpTo()
-
checkForChanges
static BuildCustomizerEx.UpToModificationSelectionMode checkForChanges()
Changes will be collected before build started and the latest modifications will be used. NB! this ignores build dependencies settings - both snapshot and soft. Equivalent for setChangesUpTo().
-
selected
static BuildCustomizerEx.UpToModificationSelectionMode selected(@NotNull SVcsModification modification)
Selected modification will be used as maxModificationId for whole created chain. NB! this ignores build dependencies settings - both snapshot and soft. Resets setChangesUpTo()- Parameters:
modification
-
-
setNodeRevisions
void setNodeRevisions(@NotNull String buildTypeId, long modId, long chainModId, @NotNull Collection<BuildRevisionEx> revisions)
Sets revision information to node of the build chain which corresponds to specified build configuration internal id- Parameters:
buildTypeId
-modId
-chainModId
-revisions
-- Since:
- 2019.1
-
setParameters
void setParameters(@NotNull List<Parameter> customParams)
Same assetParameters(List)
but acceptingParameter
instances- Since:
- 2021.1
-
addParametersIfAbsent
void addParametersIfAbsent(@NotNull List<Parameter> customParams)
Same asBuildCustomizer.addParametersIfAbsent(Map)
but acceptingParameter
instances- Since:
- 2023.11.1
-
setDependenciesSupplier
void setDependenciesSupplier(@NotNull DependenciesSupplier supplier)
Sets a custom dependencies supplier which should be used when a build promotion is created. The supplier allows to affect how build promotion build graph is created by providing dependencies different from those which are currently present in the build configuration.- Parameters:
supplier
- dependencies supplier- Since:
- 2022.02
-
setScheduledTime
void setScheduledTime(@NotNull ZonedDateTime date)
Allows to force the build to wait in the queue until some time in the future- Parameters:
date
- - the time when build can start, i.e. it's guaranteed that it won't start before- Since:
- 2023.07
-
setBuildPromotionInitializer
void setBuildPromotionInitializer(@NotNull Consumer<BuildPromotionEx> initializer)
Sets an initializer which accepts a newly created build promotion and does some initialization work there, for instance, it can set some specific settings. The initializer is not called for nodes which were specified viaBuildCustomizer.setSnapshotDependencyNodes(java.util.Collection<jetbrains.buildServer.serverSide.BuildPromotion>)
method. The initializer is called as a final step, before returning the resulting build promotion.- Parameters:
initializer
- initializer which is called for every newly created build promotion of the build chain.- Since:
- 2022.04
-
setProvidedUpperLimitRevisions
void setProvidedUpperLimitRevisions(@NotNull Map<Long,RepositoryVersion> upperLimitRevisions)
Sets upper limit revisions map as "provided" upper limit revisions: they will be used instead of the current revision during the checking for changes process- Parameters:
upperLimitRevisions
- map of VCS root instance id to repository version- Since:
- 2024.07
-
-