public interface SBuildType extends BuildTypeIdentity, BuildType, BuildTypeSettings, CompatibleAgents, Dependent, ParametersSupport, LVcsRootInstanceHolder
BuildTypeDescriptor.CheckoutType
BuildTypeOptions.BuildConfigurationType
VcsLabelingSettings.LabelingType
FULL_NAME_SEPARATOR
BT_ALLOW_EXTERNAL_STATUS, BT_ALLOW_PERSONAL_BUILD_TRIGGERING, BT_ARTIFACT_PUBLISH_CONDITION, BT_ARTIFACT_RULES, BT_BRANCH_FILTER, BT_BUILD_CONFIGURATION_TYPE, BT_BUILD_DEFAULT_BRANCH, BT_BUILD_NUMBER_PATTERN, BT_CHECKOUT_DIR, BT_CHECKOUT_MODE, BT_CLEAN_BUILD, BT_EXCLUDE_DEFAULT_BRANCH_CHANGES, BT_EXECUTION_TIMEOUT, BT_FAIL_IF_TESTS_FAIL, BT_FAIL_ON_ANY_ERROR_MESSAGE, BT_FAIL_ON_EXIT_CODE, BT_FAIL_ON_OOME_OR_CRASH, BT_HANGING_BUILDS_DETECTION_ENABLED, BT_MAX_RUNNING_BUILDS, BT_SHOW_DEPS_CHANGES, DEFAULT_BUILD_NUMBER_PATTERN, DEFAULT_VCS_LABELING_BRANCH_FILTER, VCS_LABELING_BRANCH_FILTER
DEFAULT_LABEL_PATTERN
Modifier and Type | Method and Description |
---|---|
void |
addTemplate(BuildTypeTemplate template,
boolean optimizeSettings)
Attach one more build configuration to a template.
|
SQueuedBuild |
addToQueue(BuildAgent agent,
java.lang.String triggeredBy)
Adds build instance of the configuration to the queue with the specified requestor name on the specified agent
(if agent is authorized).
|
SQueuedBuild |
addToQueue(java.lang.String triggeredBy)
Adds build instance of the configuration to the queue with the specified requestor name.
|
void |
attachToTemplate(BuildTypeTemplate template)
Deprecated.
since 2017.2 use
addTemplate(BuildTypeTemplate, boolean) instead |
void |
attachToTemplate(BuildTypeTemplate template,
boolean changeScopeOfLocalRoots)
Deprecated.
use
addTemplate(BuildTypeTemplate, boolean) instead |
boolean |
belongsTo(SProject project)
Returns true if the specified project or some of its subprojects (not only direct) contains this build configuration.
|
void |
detachFromTemplate()
Deprecated.
since 2017.2 use
removeTemplates(Collection, boolean) instead |
SBuildRunnerDescriptor |
findBuildRunnerByType(java.lang.String runnerType)
Returns first build runner of specified type or null
|
void |
forceCheckingForChanges()
Deprecated.
Use
forceCheckingForChanges(OperationRequestor) instead |
void |
forceCheckingForChanges(OperationRequestor requestor)
Starts checking for changes for all VCS roots of this build configuration
|
java.util.List<AgentCompatibility> |
getAgentCompatibilities()
Returns information about what agent are compatible with the configuration, what are incompatible and why.
|
<T extends SBuildAgent> |
getAgentCompatibility(T agent)
Returns information about agent compatibility for the specified agent.
|
java.util.List<SBuildAgent> |
getAgentsWhereBuildConfigurationBuilt()
Returns list of agents (sorted by name) where this build configuration was ever built.
|
java.io.File |
getArtifactsDirectory()
Returns directory containing artifacts of this build configuration.
|
java.util.List<SBuildType> |
getArtifactsReferences()
Returns list of build configurations which depend on this build configurations artifacts
|
BuildNumbers |
getBuildNumbers()
Returns interface to manipulate current build counter
|
BranchFilter |
getBuildTypeBranchFilter() |
<T extends BuildAgent> |
getCanRunAgents()
Returns list of agents where this build configuration can run.
|
<T extends BuildAgent> |
getCanRunAndCompatibleAgents(boolean includeDisabled)
Returns list of agents which are both allowed to run this configuration and are compatible with it.
|
CustomDataStorage |
getCustomDataStorage(java.lang.String storageId)
Returns custom data storage associated with this build configuration.
|
java.util.List<SBuildType> |
getDependencyReferences()
Returns list of build configurations directly referencing this build configuration.
|
int |
getExecutionTimeoutMin()
Returns duration the build allowed to run until killed by the server.
|
java.lang.String |
getExtendedFullName()
Returns the full name of build configuration with additional note if the project is archived.
|
java.lang.String |
getExtendedName()
Returns the name of build configuration with additional note if the project is archived.
|
byte[] |
getFileContent(java.lang.String relativePath)
Get binary content of the latest version of a file related to this build type.
|
java.util.List<SFinishedBuild> |
getHistory()
|
java.util.List<SFinishedBuild> |
getHistory(User user,
boolean includeCanceled,
boolean orderByChanges)
Returns all finished builds, visible for the specified user of this configuration.
|
java.util.List<SFinishedBuild> |
getHistoryFull(boolean orderByChanges)
|
SFinishedBuild |
getLastChangesFinished()
Returns last finished instance for the build configuration with last user changes (personal builds and canceled builds are excluded).
|
SBuild |
getLastChangesStartedBuild()
Returns instance of the build, finished or running, which contains latest changes in this build configuration
|
SFinishedBuild |
getLastChangesSuccessfullyFinished()
Returns last successfully finished build in the configuration with last user changes, personal builds are not considered
|
int |
getMaximumNumberOfBuilds()
Returns maximum number of simultaneously running builds.
|
java.util.List<SVcsModification> |
getModificationsSinceLastSuccessful()
Returns all modifications made since last successfully finished build
|
int |
getNumberOfArtifactReferences()
Returns number of dependent build configuration having references to this build configuration.
|
int |
getNumberOfDependencyReferences()
Returns number of dependency references (the number includes all references even those which are not
available because of permissions)
|
java.util.List<Dependency> |
getOwnDependencies()
Returns list of own dependencies (not inherited from a template).
|
java.util.List<? extends BuildTypeTemplate> |
getOwnTemplates()
Returns a list of templates to which the build configuration is directly attached.
|
java.util.List<VcsRootEntry> |
getOwnVcsRootEntries() |
Comment |
getPauseComment()
Returns comment for pausing/resuming this build type
|
java.util.List<SVcsModification> |
getPendingChanges()
Returns changes in this build configuration already detected but not associated with a build.
|
java.util.Collection<SUser> |
getPendingChangesCommitters()
Returns pending changes committers to this build configuration
|
SProject |
getProject()
Returns parent project for the configuration.
|
java.util.List<SQueuedBuild> |
getQueuedBuilds(User user)
If user is null returns all queued builds including all personal builds.
|
java.lang.String |
getReadOnlyReason() |
ResolvedSettings |
getResolvedSettings()
Returns resolved settings of this build configuration (with parameter references substituted)
|
java.util.List<SRunningBuild> |
getRunningBuilds()
Same as getRunningBuilds(null)
|
java.util.List<SRunningBuild> |
getRunningBuilds(User user)
|
java.util.List<java.lang.String> |
getTags()
List of all tags set for builds of this configuration.
|
java.util.List<VcsRootInstanceEntry> |
getVcsRootInstanceEntries() |
VcsRootInstanceEntry |
getVcsRootInstanceEntryForParent(SVcsRoot parentRoot) |
VcsRootInstance |
getVcsRootInstanceForParent(SVcsRoot parentRoot) |
java.util.List<VcsRootInstance> |
getVcsRootInstances() |
java.lang.String |
getVcsRootsHash()
Deprecated.
since 10.0
|
java.lang.String |
getVcsSettingsHash()
Deprecated.
since 10.0
|
java.lang.String |
getVcsSettingsHash(java.util.List<VcsRootInstanceEntry> vcsRootEntries)
Deprecated.
since 10.0
|
boolean |
isAllowExternalStatus()
Returns if viewing of the configuration status is allowed externally.
|
boolean |
isCleanBuild()
Returns if all files on an agent machine should be deleted before the build is started.
|
boolean |
isReadOnly() |
boolean |
isShouldFailBuildIfTestsFailed()
Returns
true if build of the configuration has to fail if there is failed test. |
PathMapping |
mapVcsPath(java.lang.String path)
Returns path mapping for the given full VCS path of a file if this path can correspond to any of the project's VCS roots.
|
void |
moveToProject(ConfigAction cause,
SProject target)
Moves this build configuration to the
target project. |
void |
moveToProject(SProject target)
Moves this build configuration to the
target project. |
void |
moveToProject(SProject target,
boolean changeScopeOfInaccessibleRoots)
Deprecated.
|
void |
persist()
Persists build configuration settings on disk, should be called each time when settings are changed, otherwise
the changes will be lost after the server restart.
|
void |
releaseSources()
Releases sources of the build configuration on ALL agents where this configuration built.
|
void |
releaseSources(SBuildAgent agent)
Releases sources of the build configuration on specified agent only.
|
void |
removeTemplates(java.util.Collection<? extends BuildTypeTemplate> templates,
boolean inlineSettings)
Detaches build configuration from a number of templates.
|
void |
setDescription(java.lang.String description)
Changes configuration description.
|
void |
setName(java.lang.String newName)
Renames this build configuration
|
void |
setPaused(boolean paused,
User user)
Deprecated.
|
void |
setPaused(boolean paused,
User user,
java.lang.String comment)
Pause/unpause this build configuration.
|
void |
setTemplates(java.util.List<? extends BuildTypeTemplate> templates,
boolean optimizeSettings)
Replaces templates the build configuration is attached to.
|
void |
setTemplatesOrder(java.util.List<java.lang.String> templateIds)
Imposes new order on the templates the build configuration is attached to.
|
getConfigurationFile, getExternalId, getFullName, getInternalId, getName, setExternalId, setExternalId
getConfigId, getConfigurationFile, getParent, getVersion, markPersisted, persist, remove, schedulePersisting, schedulePersisting
getBuildByBuildNumber, getBuildParameter, getBuildParameters, getNumberQueued, getParameters, getResponsibilityInfo, getStatus, getStatusDescriptor, getVcsRoots, isInQueue, removeResponsible, setResponsible
getBuildTypeId, getCheckoutType, getDescription, getExternalId, getFullName, getName, getProjectExternalId, getProjectId, getProjectName, getRunnerTypes, isPaused, isPersonal
addArtifactDependency, addBuildFeature, addBuildFeature, addBuildParameter, addBuildRunner, addBuildRunner, addBuildTrigger, addBuildTrigger, addConfigParameter, addRequirement, addVcsRoot, applyRunnersOrder, containsOwnVcsRoot, containsVcsRoot, findBuildFeatureById, findBuildRunnerById, findRunnerParameter, findTriggerById, getArtifactDependencies, getArtifactPaths, getBuildFeatureRequirements, getBuildFeatures, getBuildFeaturesOfType, getBuildNumberPattern, getBuildParameter, getBuildParameters, getBuildParametersCollection, getBuildRunners, getBuildTriggersCollection, getCheckoutDirectory, getCheckoutRules, getCheckoutType, getConfigParameters, getConfigParametersCollection, getImplicitRequirements, getRequirements, getRunnerConditions, getRunnersOrder, getRunnerTypes, getRunTypeRequirements, getTemplate, getTemplateId, getTemplateIds, getTemplates, getTypedOption, getUndefinedParameters, getVcsRootEntries, getVcsRoots, isCompositeBuildType, isDeployment, isEnabled, isTemplateAccessible, isTemplateBased, persist, removeAllBuildRunners, removeArtifactDependency, removeBuildFeature, removeBuildParameter, removeBuildRunner, removeBuildTrigger, removeConfigParameter, removeRequirement, removeRequirement, removeVcsRoot, replaceInValues, replaceInValues, resetRunnersOrder, setArtifactDependencies, setArtifactPaths, setBuildNumberPattern, setCheckoutDirectory, setCheckoutRules, setCheckoutType, setEnabled, textValueMatches, updateBuildFeature, updateBuildRunner, updateBuildTrigger
getChangedOptions, getDeclaredOption, getOption, getOptionDefaultValue, getOptions, getOwnOptions, setOption
getInheritedParametersCollection, getOwnParameter, getOwnParameters, getOwnParametersCollection, getOwnParametersWithoutInheritedSpec, getParameters, getParametersCollection
addParameter, removeParameter
getParameter, getParameterValue
getLabelingRoots, getLabelingType, getLabelPattern
getAgentCompatibility, getCompatibilityMap, getCompatibleAgents
getChildDependencies, intersectsWith
addDependency, getDependencies, removeDependency
getParametersProvider, getValueResolver
getBuildTypeId, getName
java.util.List<SFinishedBuild> getHistory()
java.util.List<SFinishedBuild> getHistoryFull(boolean orderByChanges)
orderByChanges
- if true, builds are ordered by changes, i.e. most recent build with recent changes goes first; if false, most recent builds go first, regardless change orderjava.util.List<SFinishedBuild> getHistory(@Nullable User user, boolean includeCanceled, boolean orderByChanges)
user
- specified user. If user is null no personal builds will be included into the list,
otherwise there will be personal builds for the specified user.
includeCanceled
- if canceled builds should be included.orderByChanges
- if true, builds are ordered by changes, i.e. most recent build with recent changes goes first; if false, most recent builds go first, regardless change order@Nullable SBuild getLastChangesStartedBuild()
java.util.List<AgentCompatibility> getAgentCompatibilities()
AgentCompatibility
are provided for all authorized agents.<T extends SBuildAgent> AgentCompatibility getAgentCompatibility(@NotNull T agent)
agent
- the given agent.<T extends BuildAgent> java.util.List<T> getCanRunAgents()
BuildAgentManager.RunConfigurationPolicy
allows to run
this build configuration. Note that this method does not consider agent pool associations.<T extends BuildAgent> java.util.List<T> getCanRunAndCompatibleAgents(boolean includeDisabled)
includeDisabled
- true to include disabled agents in the list, by default they are excludedBuildNumbers getBuildNumbers()
@NotNull java.util.List<SRunningBuild> getRunningBuilds(@Nullable User user)
getRunningBuilds
in interface BuildType
user
- owner of personal builds@NotNull java.util.List<SRunningBuild> getRunningBuilds()
getRunningBuilds
in interface BuildType
@Nullable SFinishedBuild getLastChangesFinished()
BuildType
getLastChangesFinished
in interface BuildType
@Nullable SFinishedBuild getLastChangesSuccessfullyFinished()
BuildType
getLastChangesSuccessfullyFinished
in interface BuildType
@Deprecated void setPaused(boolean paused, User user)
setPaused(boolean, jetbrains.buildServer.users.User, String)
paused
- if configuration should be pauseduser
- use who is pausing the configurationvoid setPaused(boolean paused, @Nullable User user, java.lang.String comment)
paused
- if configuration should be pauseduser
- use who is pausing the configurationcomment
- user comment@Nullable Comment getPauseComment()
@NotNull SProject getProject()
getProject
in interface BuildTypeIdentity
getProject
in interface BuildTypeSettings
void setName(@NotNull java.lang.String newName) throws DuplicateBuildTypeNameException, BuildTypeRenamingFailedException
setName
in interface BuildTypeIdentity
newName
- new nameDuplicateBuildTypeNameException
- if another build configuration with such name exists in the build configuration projectBuildTypeRenamingFailedException
- if build configuration renaming failedBuildTypeIdentity.getName()
,
BuildTypeIdentity.getFullName()
void setDescription(@Nullable java.lang.String description)
description
- new configuration description.java.util.List<SBuildType> getArtifactsReferences()
int getNumberOfArtifactReferences()
getArtifactsReferences()
because it
takes into account all dependent build configurations while getArtifactsReferences()
returns
only build configurations accessible to an authority currently set in the security context.@NotNull java.io.File getArtifactsDirectory()
java.util.List<SVcsModification> getPendingChanges()
getPendingChanges
in interface BuildType
java.util.Collection<SUser> getPendingChangesCommitters()
java.util.List<SVcsModification> getModificationsSinceLastSuccessful()
getModificationsSinceLastSuccessful
in interface BuildType
@Deprecated @NotNull java.lang.String getVcsSettingsHash(@NotNull java.util.List<VcsRootInstanceEntry> vcsRootEntries)
BuildTypeDescriptor.getCheckoutType()
and checkout rules BuildTypeSettings.getCheckoutRules(jetbrains.buildServer.vcs.VcsRoot)
Deprecated since 10.0, because for auto checkout mode this hash depends on effective checkout mode and is calculated on the agent.
As a workaround, for auto checkout this method returns hash as if agent checkout is used.vcsRootEntries
- vcs roots with checkout rules to get name hash for.BuildTypeSettings.setCheckoutDirectory(String)
@NotNull @Deprecated java.lang.String getVcsSettingsHash()
@NotNull @Deprecated java.lang.String getVcsRootsHash()
void releaseSources()
void releaseSources(@NotNull SBuildAgent agent)
agent
- agent@NotNull java.util.List<SBuildAgent> getAgentsWhereBuildConfigurationBuilt()
java.util.List<java.lang.String> getTags()
void forceCheckingForChanges()
forceCheckingForChanges(OperationRequestor)
insteadvoid forceCheckingForChanges(@NotNull OperationRequestor requestor)
@Nullable SQueuedBuild addToQueue(@NotNull java.lang.String triggeredBy)
triggeredBy
- contains details about who triggered build, see also TriggeredByBuilder
@Nullable SQueuedBuild addToQueue(@NotNull BuildAgent agent, @NotNull java.lang.String triggeredBy)
agent
- specified agent.triggeredBy
- contains details about who triggered build, see also TriggeredByBuilder
null
if agent is not authorized,
new SQueuedBuild instance if queue does not contain
this configuration with specified agent and existing one otherwise@NotNull java.util.List<SQueuedBuild> getQueuedBuilds(@Nullable User user)
user
- userboolean isCleanBuild()
BuildTypeOptions.BT_CLEAN_BUILD
boolean isShouldFailBuildIfTestsFailed()
true
if build of the configuration has to fail if there is failed test.BuildTypeOptions.BT_FAIL_IF_TESTS_FAIL
int getExecutionTimeoutMin()
BuildTypeOptions.BT_EXECUTION_TIMEOUT
int getMaximumNumberOfBuilds()
BuildTypeOptions.BT_MAX_RUNNING_BUILDS
boolean isAllowExternalStatus()
BuildTypeOptions.BT_ALLOW_EXTERNAL_STATUS
@Deprecated void moveToProject(@NotNull SProject target, boolean changeScopeOfInaccessibleRoots) throws InvalidVcsRootScopeException
moveToProject(SProject)
target
project.target
- the destination projectchangeScopeOfInaccessibleRoots
- not used since 8.0InvalidVcsRootScopeException
- thrown since 8.0 if VCS roots used by this configuration will not be accessible in the target projectvoid moveToProject(@NotNull SProject target) throws InvalidVcsRootScopeException
target
project.target
- the destination projectInvalidVcsRootScopeException
- if VCS roots used by this configuration will not be accessible in the target projectvoid moveToProject(@NotNull ConfigAction cause, @NotNull SProject target) throws InvalidVcsRootScopeException
target
project.cause
- config action caused the changetarget
- the destination projectInvalidVcsRootScopeException
- if VCS roots used by this configuration will not be accessible in the target project@Nullable PathMapping mapVcsPath(@NotNull java.lang.String path)
path
- a full path to a file (not necessarily existing)@NotNull java.lang.String getExtendedName()
SProject.getExtendedName()
@NotNull java.lang.String getExtendedFullName()
SProject.getExtendedFullName()
@NotNull byte[] getFileContent(@NotNull java.lang.String relativePath) throws VcsException
relativePath
- - relative file path regarding to the project root,
"checkout root" from vcs root should not be includedVcsException
- if some problem occurred while getting file content from the source control repository.void setTemplates(@NotNull java.util.List<? extends BuildTypeTemplate> templates, boolean optimizeSettings)
templates
- Ordered list of templates, the earlier a template in the list, the higher priority its settings haveoptimizeSettings
- If true, the build configuration's owner settings will be optimised by eliminating duplication
with the effective settings coming from the templates.void addTemplate(@NotNull BuildTypeTemplate template, boolean optimizeSettings)
template
- see aboveoptimizeSettings
- If true, the build configuration's owner settings will be optimised by eliminating duplicationvoid removeTemplates(@NotNull java.util.Collection<? extends BuildTypeTemplate> templates, boolean inlineSettings)
templates
- a collection of templates, the configuration must be attached to these (and possible some other) templatesinlineSettings
- if true, the effective settings coming from these templates are copied to the build configuration@Deprecated void attachToTemplate(@NotNull BuildTypeTemplate template, boolean changeScopeOfLocalRoots) throws InvalidVcsRootScopeException, CannotAttachToTemplateException
addTemplate(BuildTypeTemplate, boolean)
insteadtemplate
- templatechangeScopeOfLocalRoots
- if true then local non accessible VCS roots will be shared (not used since 8.0)InvalidVcsRootScopeException
- if at least one of VCS roots from provided template is inaccessible in this build configuration and changeScopeOfLocalRoots == falseCannotAttachToTemplateException
- if template is not accessible from this build configuration@Deprecated void attachToTemplate(@NotNull BuildTypeTemplate template) throws CannotAttachToTemplateException
addTemplate(BuildTypeTemplate, boolean)
insteadtemplate
- templateCannotAttachToTemplateException
- if template is not accessible from this build configuration@Deprecated void detachFromTemplate()
removeTemplates(Collection, boolean)
insteadvoid setTemplatesOrder(java.util.List<java.lang.String> templateIds)
templateIds
- the existing template ids in the new order. The list must match currently associated templates,
excluding the default template.java.util.List<? extends BuildTypeTemplate> getOwnTemplates()
void persist() throws PersistFailedException
persist
in interface BuildTypeSettings
persist
in interface SPersistentEntity
PersistFailedException
- if persisting failed@NotNull ResolvedSettings getResolvedSettings()
@NotNull java.util.List<Dependency> getOwnDependencies()
@NotNull CustomDataStorage getCustomDataStorage(@NotNull java.lang.String storageId)
storageId
- - id of the storage. Custom data storageIds starting with "teamcity" are reserved for TeamCity internal usages.
To reduce probability of identifiers clashing plugins can use fully qualified names of their classes or package names as storageId.@Nullable SBuildRunnerDescriptor findBuildRunnerByType(@NotNull java.lang.String runnerType)
findBuildRunnerByType
in interface BuildType
findBuildRunnerByType
in interface BuildTypeSettings
runnerType
- type of the runner@NotNull java.util.List<VcsRootInstanceEntry> getVcsRootInstanceEntries()
@Nullable VcsRootInstance getVcsRootInstanceForParent(@NotNull SVcsRoot parentRoot)
@Nullable VcsRootInstanceEntry getVcsRootInstanceEntryForParent(@NotNull SVcsRoot parentRoot)
@NotNull java.util.List<VcsRootInstance> getVcsRootInstances()
boolean belongsTo(@NotNull SProject project)
belongsTo
in interface BuildTypeIdentity
project
- project@NotNull java.util.List<VcsRootEntry> getOwnVcsRootEntries()
@NotNull java.util.List<SBuildType> getDependencyReferences()
int getNumberOfDependencyReferences()
boolean isReadOnly()
@Nullable java.lang.String getReadOnlyReason()
@NotNull BranchFilter getBuildTypeBranchFilter()