Class DummyBuildType
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.DummyBuildType
-
- All Implemented Interfaces:
Comparable<BuildTypeDescriptor>,BuildType,BuildTypeDescriptor,BuildConfigurationInfo,BuildTypeEx,BuildTypeIdentity,BuildTypeIdentityEx,BuildTypeOptions,BuildTypeSettings,CleanupSettings,CleanupSettingsInit,CompatibleAgents,DependencySettings,Dependent,InheritableUserParametersHolder,InheritableUserParametersHolderEx,InternalParameters,LVcsRootInstanceHolder,LVcsRootInstanceHolderEx,ParametersSupport,ReadOnlyUserParameters,ResolvedSettings,SBuildType,SPersistentEntity,UserParametersHolder,VcsLabelingSettings,VcsWorkspaceAccess,OptionSupport
public class DummyBuildType extends Object implements BuildTypeEx, ResolvedSettings
- Author:
- Pavel.Sher
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.BuildTypeDescriptor
BuildTypeDescriptor.CheckoutType
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.BuildTypeOptions
BuildTypeOptions.BuildConfigurationType
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.vcs.VcsLabelingSettings
VcsLabelingSettings.LabelingType
-
-
Field Summary
-
Fields inherited from interface jetbrains.buildServer.BuildTypeDescriptor
FULL_NAME_SEPARATOR
-
Fields inherited from interface jetbrains.buildServer.serverSide.BuildTypeOptions
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_GENERATED_SETTINGS_CHECKSUM, BT_HANGING_BUILDS_DETECTION_ENABLED, BT_MAX_RUNNING_BUILDS, BT_MAX_RUNNING_BUILDS_PER_BRANCH, BT_SHOW_DEPS_CHANGES, BT_SUPPORT_TEST_RETRY, DEFAULT_BUILD_NUMBER_PATTERN, DEFAULT_MAX_RUNNING_BUILDS_PER_BRANCH, DEFAULT_VCS_LABELING_BRANCH_FILTER, VCS_LABELING_BRANCH_FILTER
-
Fields inherited from interface jetbrains.buildServer.serverSide.CleanupSettings
CLEANUP_PREVENT_DEPENDENCIES_ARTIFACTS_FROM_CLEANUP, DISABLE_CLEANUP_POLICIES
-
Fields inherited from interface jetbrains.buildServer.serverSide.vcs.VcsLabelingSettings
DEFAULT_LABEL_PATTERN
-
-
Constructor Summary
Constructors Constructor Description DummyBuildType(BuildTypeSettingsEx buildTypeSettings, BranchSpec specs, VcsRootInstancesManagerEx vcsRootInstancesManager, BuildPromotionManagerEx promotionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddArtifactDependency(SArtifactDependency dependency)Adds artifact dependency.SBuildFeatureDescriptoraddBuildFeature(String type, Map<String,String> params)Adds build feature with specified type and parameters to this settings object.voidaddBuildFeature(SBuildFeatureDescriptor feature)Adds build feature descriptor to this settings object.voidaddBuildParameter(Parameter parameter)Adds build parameter to the configuration.SBuildRunnerDescriptoraddBuildRunner(String id, String name, String runnerType, Map<String,String> parameters)Creates a new build runner with the specified id, name, runner type, and parameters, and adds it to the current build settings.SBuildRunnerDescriptoraddBuildRunner(String name, String runnerType, Map<String,String> parameters)Creates new build runner and adds it to these settings.SBuildRunnerDescriptoraddBuildRunner(BuildRunnerDescriptor runner)Adds runner descriptor.BuildTriggerDescriptoraddBuildTrigger(String type, Map<String,String> params)Adds new trigger of specified type and with specified parameters to build configuration settings.booleanaddBuildTrigger(BuildTriggerDescriptor triggerDescriptor)Adds new trigger to build configuration settings.voidaddCleanupPolicy(HistoryRetentionPolicy policy)Sets cleanup policy for this build configurationvoidaddConfigParameter(Parameter param)Adds configuration parameter.voidaddDependency(Dependency dependOn)Add dependency on another build configurationvoidaddParameter(Parameter param)Adds parameter.voidaddRequirement(Requirement requirement)Adds new build requirement to the configuration.voidaddRunParameter(Parameter parameter)For tests only!voidaddTemplate(BuildTypeTemplate template, boolean optimizeSettings)Attach one more build configuration to a template.SQueuedBuildaddToQueue(String triggeredBy)Adds build instance of the configuration to the queue with the specified requestor name.SQueuedBuildaddToQueue(BuildAgent agent, String triggeredBy)Adds build instance of the configuration to the queue with the specified requestor name on the specified agent (if agent is authorized).SQueuedBuildaddToQueue(BuildPromotionEx buildPromotion, String triggeredBy)Adds build to queue with specified build promotion.SQueuedBuildaddToQueue(SAgentRestrictor agentRestrictor, BuildPromotionEx buildPromotion, String triggeredBy)Adds build to queue on the specified agent with manually set build parameters: these build parameters will redefined build parameters specified within this build configurationbooleanaddVcsRoot(SVcsRoot root)Adds VCS root to the build configuration with default checkout rules.voidapplyRunnersOrder(String[] ids)Accepts array of runner identifiers and reorders them according to this array.voidattachedToModel(ProjectDataModel model)voidattachToTemplate(BuildTypeTemplate template)Attaches this build configuration to the specified template.voidattachToTemplate(BuildTypeTemplate template, boolean changeVcsRootsScope)Attaches this build configuration to the specified templatebooleanbelongsTo(SProject project)Checks whether this build type or template belongs to the specified project or one of its subprojects, transitively.voidbranchesChanged(boolean currentNodeEvent, Date branchChangeTimestamp)Notifies build configuration that the branches may have changed.booleancanListFiles()voidclearPrevPromotionCache(Collection<BuildPromotion> targetPromos)intcompareTo(BuildTypeDescriptor o)booleancontainsOwnVcsRoot(long vcsRootId)Returns true if VCS root with specified id is attached directly and is not inherited via a templatebooleancontainsVcsRoot(long vcsRootId)Returns true if VCS root with specified id is attached directly or is inherited via a templateBuildCustomizercreateBuildCustomizer(SUser user)CreatesBuildCustomizerthat can be used to create custom promotions for this build typeBuildPromotionExcreateBuildPromotion()Creates new build promotion which then can be used when build is added to a queue.BuildPromotionExcreateBuildPromotion(String branchName)Creates build promotion graph and sets specified branch name to all its nodes.BuildPromotionExcreateBuildPromotion(String branchName, BuildPromotionInitializer initializer)Same asBuildTypeEx.createBuildPromotion(String)but accepts initializer which is called for every new build promotion in the created build chainBuildPromotionExcreateBuildPromotion(String branchName, BuildPromotionInitializer initializer, DependenciesSupplier dependenciesSupplier)Same asBuildTypeEx.createBuildPromotion(String)but accepts initializer and dependencies supplier.ConfigActioncreateConfigAction(SUser user, String description)Creates a config action instance associated with this entity and having the specified description.BuildTypeExcreateEditableCopy(boolean fillSettings)RemoteBuildTypeExcreatePersonalBuildType(User user, long changeListId)Creates personal build type, i.e.RemoteBuildTypeExcreatePersonalBuildType(User user, String comment)Creates personal build type, i.e.RemoteBuildTypeExcreatePersonalBuildType(User user, String comment, Map<VcsRootInstance,VcsRootInstance> overridenRoots)Create personal build type that starts build with overriden roots.voiddetachFromTemplate()Detaches build configuration from all templates, except for the default one if present.voiddispose()Must be called when this build configuration object is removed from the model.SBuildFeatureDescriptorfindBuildFeatureById(String featureId)Returns build feature with specified idSBuildRunnerDescriptorfindBuildRunnerById(String runnerId)Finds build runner by its' idSBuildRunnerDescriptorfindBuildRunnerByType(String runnerType)Returns first build runner of specified type or nullStringfindRunnerParameter(String paramName)Searches runner parameter in all build runners and returns value of the first found parameter with given name.Collection<BuildTypeEx>findTops()BuildTriggerDescriptorfindTriggerById(String triggerId)Finds build trigger descriptor by its' idvoidforceCheckingForChanges()Starts checking for changes for all VCS roots of this build configurationvoidforceCheckingForChanges(OperationRequestor requestor)Starts checking for changes for all VCS roots of this build configurationList<BranchEx>getActiveBranches()Set<String>getAdditionalBranchesForChangesCollecting(LVcsRootInstance root, VcsRepositoryState state)List<BranchSpec>getAdditionalBranchSpecs(LVcsRootInstance root, VcsRepositoryState state)List<BranchSpec>getAdditionalBranchSpecs(VcsRootInstance root, VcsRepositoryState state)List<AgentCompatibility>getAgentCompatibilities()Returns information about what agent are compatible with the configuration, what are incompatible and why.CompatibilityResultgetAgentCompatibility(AgentDescription agentDescription)Fetches compatibility information for given agent descriptionAgentCompatibilitygetAgentCompatibility(SBuildAgent agent)Returns information about agent compatibility for the specified agent.List<SBuildAgent>getAgentsWhereBuildConfigurationBuilt()Returns list of agents (sorted by name) where this build configuration was ever built.AgentCompatibilitygetAgentTypeCompatibility(SAgentType agentType)List<SArtifactDependency>getArtifactDependencies()Returns artifacts this build configuration depending on.List<File>getArtifactDirectories()StringgetArtifactPaths()Returns build artifact paths.FilegetArtifactsDirectory()Returns directory containing artifacts of this build configuration.List<SBuildType>getArtifactsReferences()Returns list of build configurations which depend on this build configurations artifactsBranchExgetBranch(String name)BranchExgetBranchByDisplayName(String branchDisplayName)Returns a branch by its display name.List<BranchEx>getBranches(BranchCalculationOptions branchCalculationOptions)List<BranchEx>getBranches(BranchesPolicy policy, Boolean includeBranchesFromDependencies)List<BranchEx>getBranches(BranchesPolicy policy, Boolean includeBranchesFromDependencies, boolean computeTimestamps)BranchSpecgetBranchSpec(LVcsRootInstance root)BranchSpecgetBranchSpec(SVcsRoot root)Returns branch specification for specified parent rootBranchSpecgetBranchSpec(VcsRootInstance root)BuildgetBuildByBuildNumber(String buildNumber)Returns most recent build instance with specified build number.longgetBuildDuration(BuildAgent agent)Returns estimated duration of a build on the specified agent.List<Requirement>getBuildFeatureRequirements()Returns list of additional agent requirements imposed by configured enabled build features.Collection<SBuildFeatureDescriptor>getBuildFeatures()Returns build features added to this settings object.Collection<SBuildFeatureDescriptor>getBuildFeaturesOfType(String featureType)Returns all build features of specified type.StringgetBuildNumberPattern()Returns current build number patternBuildNumbersgetBuildNumbers()Returns interface to manipulate current build counterStringgetBuildParameter(String key)Returns build parameter by parameter keyMap<String,String>getBuildParameters()Returns the map of build parameters specified by user.Collection<Parameter>getBuildParametersCollection()Returns build parameters collection.List<SBuildRunnerDescriptor>getBuildRunners()Returns collection of build runners attached to these settingsBuildSettingsgetBuildSettings()Returns build settings: settings for build (where excluded disabled options and features).Collection<BuildTriggerDescriptor>getBuildTriggerDescriptors(String triggerName, boolean enabledOnly)Collection<BuildTriggerDescriptor>getBuildTriggersCollection()Returns collection of build trigger settingsBranchFiltergetBuildTypeBranchFilter()BranchFiltergetBuildTypeBranchFilterUnsafe()Same asSBuildType.getBuildTypeBranchFilter()but throws an exception if the branch filter is incorrectStringgetBuildTypeId()Returns build configuration internal id.BuildTypeOrderedBuildsgetBuildTypeOrderedBuilds()List<BuildAgentEx>getCanRunAgents()Returns list of agents where this build configuration can run.List<BuildAgentEx>getCanRunAndCompatibleAgents(boolean includeDisabled)Returns list of agents which are both allowed to run this configuration and are compatible with it.List<StartableAgentType>getCanRunAndCompatibleAgentTypes()Returns list of cloud agent types which are both allowed to run this configuration and are compatible with it.Option[]getChangedOptions()Return options with changed values, i.e.StringgetCheckoutDirectory()Returns build checkout directory - if specified explicitly usingBuildTypeSettings.setCheckoutDirectory(String).CheckoutRulesgetCheckoutRules(VcsRoot root)Returns checkout rules configured for the specified VCS root.BuildTypeDescriptor.CheckoutTypegetCheckoutType()Returns method used by agent to retrieve project sources.Collection<SBuildType>getChildDependencies()Returns all child dependencies collected down the chain.Map<String,Boolean>getCleanupOptions()Collection<HistoryRetentionPolicy>getCleanupPolicies()Map<SBuildAgent,CompatibilityResult>getCompatibilityMap()Returns compatibility map, key is an agent and value is compatibility result.Collection<SBuildAgent>getCompatibleAgents()Returns collection of compatible agentsStringgetConfigId()Returns the entity's config identifier.Map<String,String>getConfigParameters()Returns map of configuration parametersCollection<Parameter>getConfigParametersCollection()Returns collection of configuration parameters.FilegetConfigurationFile()Returns the configuration file where this build type or template is persisted (or will be persisted to).FilegetConfigurationFile(File projectsDir)Returns the configuration file where this entity is persisted in custom projects directoryCustomDataStoragegetCustomDataStorage(String storageId)Returns custom data storage associated with this build configuration.StringgetDefaultBranchDisplayName()Returns a display name of the default branch according to the current settings of all VCS roots attached to build configuration (their default branch vcs names and branch specs).Map<SBuildType,DependencyOptions>getDependedOnMe()List<Dependency>getDependencies()Get existing dependencies, empty collection when no dependencies existBuildTypeDependencyGraphgetDependencyGraph()List<SBuildType>getDependencyReferences()Returns list of build configurations directly referencing this build configuration.StringgetDescription()Returns configuration description.List<ChangeDescriptor>getDetectedChanges(SelectPrevBuildPolicy policy)List<ChangeDescriptor>getDetectedChanges(SelectPrevBuildPolicy prevBuildPolicy, Boolean includeDependencyChanges)DummyBuildgetDummyBuild()DummyBuildPromotiongetDummyBuildPromotion()DummyBuildPromotiongetDummyBuildPromotion(boolean createIfNotExists)EntityId<String>getEntityId()Returns the instance of the entity identifier.Set<Long>getExcludedDefaultRootInstanceIds()Returns set of vcs root instance ids with excluded default branchintgetExecutionTimeoutMin()Returns duration the build allowed to run until killed by the server.StringgetExtendedFullName()Returns the full name of build configuration with additional note if the project is archived.StringgetExtendedName()Returns the name of build configuration with additional note if the project is archived.StringgetExternalId()Returns the external identifier.byte[]getFileContent(String relativePath)Get binary content of the latest version of a file related to this build type.byte[]getFileContent(String relativePath, boolean latest)Same as {@link #getFileContent(String, false)}StringgetFullName()Name of the project and name of the identity.List<SFinishedBuild>getHistory()List<SFinishedBuild>getHistory(User user, boolean includeCanceled, boolean orderByChanges)Returns all finished builds, visible for the specified user of this configuration.List<SFinishedBuild>getHistoryFull(boolean orderByChanges)StringgetId()Returns build configuration internal idList<Requirement>getImplicitRequirements()Get list of non-satisfied implicit requirements for build agents.Map<String,Boolean>getInheritedCleanupOptions()Collection<HistoryRetentionPolicy>getInheritedCleanupPolicies()Collection<Parameter>getInheritedParametersCollection()StringgetInternalId()Returns the internal identifier.List<VcsRoot>getLabelingRoots()List of roots which should be processed by labeling processVcsLabelingSettings.LabelingTypegetLabelingType()StringgetLabelPattern()SFinishedBuildgetLastChangesFinished()Returns last finished instance for the build configuration with last user changes (personal builds and canceled builds are excluded).SBuildgetLastChangesStartedBuild()Returns instance of the build, finished or running, which contains latest changes in this build configurationSFinishedBuildgetLastChangesSuccessfullyFinished()Returns last successfully finished build in the configuration with last user changes, personal builds are not consideredAuditLogActiongetLastConfigModificationAction()CommentgetLastPauseComment()Differs fromSBuildType.getPauseComment()- it returns last comment for pause action only.BranchSpecgetLastUsedBranchSpec(SVcsRoot parentRoot)Returns branch specification used for changes collecting in given VCS root.Map<VcsRootInstance,BranchSpec>getLastUsedBranchSpecMap()Map<VcsRootInstance,BranchSpec>getLastUsedBranchSpecMap(boolean includeSettingsRoot)List<SBuild>getLatestBuilds()Set<String>getLogicalBranchNames(VcsRootInstance root, String vcsBranch)Returns set of possible logical names for the given VCS branch in the given VCS root according to current VCS root settings (i.e.intgetMaximumNumberOfBuilds()Returns maximum number of simultaneously running builds.StringgetMaximumNumberOfBuildsPerBranch()List<SVcsModification>getModificationsSinceLastSuccessful()Returns all modifications made since last successfully finished buildStringgetName()The name of the identity.intgetNumberOfArtifactReferences()Returns number of dependent build configuration having references to this build configuration.intgetNumberOfDependencyReferences()Returns number of dependency references (the number includes all references even those which are not available because of permissions)intgetNumberQueued()Returns number of items for this build configurations currently waiting in queue<T> TgetOption(Option<T> option)Get option value<T> TgetOptionDefaultValue(Option<T> option)Collection<Option>getOptions()Map<String,Boolean>getOwnCleanupOptions()Collection<HistoryRetentionPolicy>getOwnCleanupPolicies()List<Dependency>getOwnDependencies()Returns list of own dependencies (not inherited from a template).ParametergetOwnNonInheritedParameter(String paramName)Own parameter without inherited parameter spec.Collection<Option>getOwnOptions()Return options defined in this object, i.e.ParametergetOwnParameter(String paramName)Map<String,String>getOwnParameters()Collection<Parameter>getOwnParametersCollection()Collection<Parameter>getOwnParametersWithoutInheritedSpec()List<? extends BuildTypeTemplate>getOwnTemplates()Returns a list of templates to which the build configuration is directly attached.Collection<String>getOwnVcsBranchNames(boolean activeOnly)List<VcsRootEntry>getOwnVcsRootEntries()ParametergetParameter(String paramName)Map<String,String>getParameters()Returns map of build and configuration parameters.Collection<Parameter>getParametersCollection()Returns build and configuration parameters in single collection.ParametersProvidergetParametersProvider()Returns parameters which can be used by value resolver.StringgetParameterValue(String paramName)SPersistentEntitygetParent()The parent entity.CommentgetPauseComment()Returns comment for pausing/resuming this build typeList<SVcsModification>getPendingChanges()Returns changes in this build configuration already detected but not associated with a build.Collection<SUser>getPendingChangesCommitters()Returns pending changes committers to this build configurationList<ChangeDescriptor>getPendingChangesInAllBranches(Boolean includeDependencyChanges)Returns pending changes detected in all branches of this build configuration.List<ChangeDescriptor>getPendingChangesInAllBranches(Boolean includeDependencyChanges, VcsModificationProcessor callback)ProjectExgetProject()Returns the project this build type entity belongs to.StringgetProjectExternalId()Returns external id of the project this build configuration configured in.StringgetProjectId()Returns internal id of the project this build configuration configured in.StringgetProjectName()Returns project name this configuration belongs to.List<SQueuedBuild>getQueuedBuilds()List<SQueuedBuild>getQueuedBuilds(User user)If user is null or has "Show personal builds of other users" enabled, returns all queued builds including all personal builds.Map<String,DependencyOptions>getRawDependedOnMe()Map from internal build type id to dependency optionsReadOnlyReasongetReadOnlyReason()Set<Long>getRelatedVcsRootInstanceIds()Returns ids of VCS root instances which reported changes associated with this build configuration.List<Requirement>getRequirements()Get list of explicit requirements for build agents which can run this build configuration.Collection<BuildTriggerDescriptor>getResolvedBuildTriggerDescriptors(boolean enabledOnly)Collection<BuildTriggerDescriptor>getResolvedBuildTriggerDescriptors(String triggerName, boolean enabledOnly)ResolvedSettingsgetResolvedSettings()Returns resolved settings of this build configuration (with parameter references substituted)ResponsibilityEntrygetResponsibilityInfo()Returns the information about responsibility on this build configuration.StringgetRunBuildActionName()BuildStepConditionsgetRunnerConditions(SBuildRunnerDescriptor descriptor)String[]getRunnersOrder()Collection<String>getRunnerTypes()Returns collection of types of enabled build runners configured in this configurationList<SRunningBuild>getRunningBuilds()Same as getRunningBuilds(null)List<SRunningBuild>getRunningBuilds(User user)List<Requirement>getRunTypeRequirements()Returns list of additional agent requirements imposed by configured runners.BuildTypeSettingsExgetSettings()SBuildTypegetSourceBuildType()If current instance is an instance of RemoteBuildType - returns base configuration for remote build type, otherwise - returns this.StatusgetStatus()Returns current status of the configuration.BuildTypeStatusDescriptorgetStatusDescriptor()Returns current status of the configuration with text description and status build.List<String>getTags()List of all tags set for builds of this configuration.List<String>getTags(SUser user)List of all private tags set for builds of this configuration by the specified user.BuildTypeTemplategetTemplate()Returns the first template these settings are based on.StringgetTemplateId()Returns internal id of the first template this setting is based onList<String>getTemplateIds()Returns internal ids of the templates this settings are based on, including one of the default templateList<? extends BuildTypeTemplate>getTemplates()Returns templates these settings are based on, including the default template.List<SBuildType>getTransitiveDependedOnMe()Returns all build configurations collected up the dependency chain.List<String>getUndefinedParameters()Returns collection of parameter names (config and build params) referenced in the build configuration settings but without values provided.ValueResolvergetValueResolver()Returns value resolver which can be used to resolve references in valuesBrowsergetVcsFilesBrowser()BrowsergetVcsFoldersBrowser()List<VcsRootEntry>getVcsRootEntries()Returns all entries of vcs roots.List<VcsRootInstanceEntry>getVcsRootInstanceEntries()List<VcsRootInstanceEntry>getVcsRootInstanceEntries(boolean includeSettingsRoot)Returns entries for VCS roots attached to this buildType.List<VcsRootInstanceEntry>getVcsRootInstanceEntries(Set<String> vcsNames, boolean includeSettingsRoot)Returns entries corresponding to specified vcs support namesVcsRootInstanceEntrygetVcsRootInstanceEntryForParent(SVcsRoot parentRoot)VcsRootInstancegetVcsRootInstanceForParent(SVcsRoot parentRoot)List<VcsRootInstance>getVcsRootInstances()List<SVcsRoot>getVcsRoots()Returns all roots currently attached to this configurationStringgetVcsRootsHash()Returns build configuration vcs roots hash without taking checkout directory into account
The resulting hash is an equal to the default checkout directory (since 10.0 it is true only for not auto checkout type).StringgetVcsRootsHash(BuildTypeDescriptor.CheckoutType checkoutType)Returns build configuration vcs roots hash without taking checkout directory into account
The resulting hash is an equal to the default checkout directory.StringgetVcsSettingsHash()Returns build configuration vcs settings hash.StringgetVcsSettingsHash(List<VcsRootInstanceEntry> vcsRootEntries)Return name of the directory which should be used as checkout directory for this build configuration if explicit checkout directory is not specified.PersistentEntityVersiongetVersion()Returns version of this entity which can be used to check if the entity was edited or persisted.booleanhasBuilds()booleanhasOwnBranches()BuildTypeExinline()Creates a temporary copy of this buildType with all settings inherited from a project or a template inlined.booleanintersectsWith(Dependent dependent)Returns true if this object dependencies intersect (have same nodes) with specified object dependencies.booleanisAgentLessBuildType()booleanisAllowExternalStatus()Returns if viewing of the configuration status is allowed externally.booleanisBranchSpecDefined(boolean processDependencies)booleanisBranchSpecDefined(boolean processDependencies, boolean processSettingsRoot)booleanisCleanBuild()Returns if all files on an agent machine should be deleted before the build is started.booleanisCompositeBuildType()booleanisDefaultBranchExcluded()Returns true default branch is excluded in the build configuration branch filterbooleanisDeployment()booleanisEmptyUuid()booleanisEnabled(String paramsDescriptorId)Returns true if descriptor with specified id (runner, trigger or build feature) is enabled and false otherwise.booleanisImplicitSettingsRoot(VcsRootInstance root)Returns true if the specified VCS root is an implicit settings root, ie.booleanisInQueue()Returns true if the configuration is queued at the momentbooleanisPaused()Returns if the configuration is paused.booleanisPersonal()Returns if the configuration is temporary created for the personal build.booleanisReadOnly()booleanisShouldFailBuildIfTestsFailed()Returnstrueif build of the configuration has to fail if there is failed test.booleanisTemplateAccessible()Checks accessibility of all attached templates, excluding the default template (if present)booleanisTemplateBased()Returns true if these settings are directly based on a template.booleanisValidVcsBranch(String name, boolean includeBranchesFromDependencies)booleanisVirtual()List<VcsFile>listFiles(String relativePath)Lists files in the directory specified by relativePathPathMappingmapVcsPath(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.voidmarkPersisted(long expectedEditId)Marks entity as persistedvoidmoveToProject(ConfigAction cause, SProject target)Moves this build configuration to thetargetproject.voidmoveToProject(SProject target)Moves this build configuration to thetargetproject.voidmoveToProject(SProject target, boolean changeScopeOfLocalRoots)Moves this build configuration to thetargetproject.RunningBuildExnewAgentLessBuild(QueuedBuildEx queuedBuild, SBuildAgent buildAgent, Date removeFromQueueTime)Creates new SRunningBuild instance and sets executor name as a build promotion attribute for the purposes of Executor mode builds.RunningBuildExnewRunningBuild(QueuedBuildEx queuedBuild, SBuildAgent buildAgent, Date removeFromQueueTime)Creates new SRunningBuild instance.voidpersist()Persists this entity instance onto disk.voidpersist(String comment)voidpersist(ConfigAction cause)Persists this entity on disk.voidprocessHistoryEntries(ItemProcessor<SFinishedBuild> itemProcessor)Invokes the given ItemProcessor for all history records of this build type.voidreassignIntId(String internalId)Assigns the specified internalId to this buildType.voidreleaseSources()Releases sources of the build configuration on ALL agents where this configuration built.voidreleaseSources(SBuildAgent agent)Releases sources of the build configuration on specified agent only.booleanrememberLastUsedRootInstanceAndBranchSpec(LVcsRootInstance rootInst, BranchSpec spec)Stores branch specification used for changes collecting in given VCS root and resets a pending changes cache if root or spec is changed since last call to this method or whenforcePendingChangesResetis truevoidremove()Removes this entity.voidremoveAllBuildRunners()Removes all build runnersvoidremoveArtifactDependency(SArtifactDependency dependency)Removes artifact dependency.SBuildFeatureDescriptorremoveBuildFeature(String featureId)Removes build feature with specified id from this settings object.voidremoveBuildParameter(String paramName)Removes existing build parameter by its name.SBuildRunnerDescriptorremoveBuildRunner(String runnerId)Removes runner descriptor with specified id.booleanremoveBuildTrigger(BuildTriggerDescriptor triggerDescriptor)Removes specified build trigger from the settingsvoidremoveCleanupPolicies()Remove all own cleanup policies for the objectvoidremoveConfigParameter(String paramName)Removes configuration parameters with specified namebooleanremoveDependency(Dependency dependOn)Remove dependency on another build configurationvoidremoveParameter(String paramName)Removes parameter.voidremoveRequirement(String propertyName)Removes first requirement with the specified property name from the configuration.voidremoveRequirement(Requirement requirement)Removes a requirement from the configuration.voidremoveResponsible(boolean buildWasFixed, User responsibleUser, String comment, User whoPerformsTheAction)Removes responsible information , mark it is either 'fixed' or 'not fixed'.voidremoveTemplates(Collection<? extends BuildTypeTemplate> templates, boolean inlineSettings)Detaches build configuration from a number of templates.booleanremoveVcsRoot(SVcsRoot root)Removes existing VCS root from the build configuration.booleanreplaceInValues(String regexp, String replacement)Replaces values according to specified regexp and replacement string in all text parameters of the build configurationbooleanreplaceInValues(Pattern regexpPattern, String replacement)Replaces values according to specified pattern and replacement string in all text parameters of the build configurationbooleanreplaceVcsRoot(SVcsRoot oldVcsRoot, SVcsRoot newVcsRoot)Replaces existing VCS root entry in settings with a new one, maintaining the order of the root entriesvoidresetPendingChanges()voidresetRunnersOrder()Resets custom runner order to default.PersistTaskschedulePersisting(String reason)Schedules background persisting of this entity settings.PersistTaskschedulePersisting(ConfigAction cause)Schedules background persisting of this project settings.PersistTaskscheduleRemove(ConfigAction cause)Schedules remove of this persistent entity.voidsendExtIdChangedEvents(ConfigAction cause, String oldExternalId, String newExternalId)This method can be used to send external id changed event.voidsetArtifactDependencies(List<SArtifactDependency> artifacts)Sets artifacts this build configuration depending on.voidsetArtifactPaths(String artifactPaths)Sets build artifact paths.voidsetBuildNumberPattern(String pattern)Sets build number pattern.voidsetCheckoutDirectory(String dir)Sets build checkout directory.booleansetCheckoutRules(VcsRoot root, CheckoutRules checkoutRules)Sets checkout rules for specified VCS root.voidsetCheckoutType(BuildTypeDescriptor.CheckoutType type)Sets preferred checkout type for the configuration sources.voidsetCleanupOption(String option, Boolean value)Sets value for a cleanup optionvoidsetDescription(String description)Changes configuration description.voidsetEditable(boolean editable)Enables or disables editing of the build type in web UI, see alsoSPersistentEntity.isReadOnly().voidsetEnabled(String paramsDescriptorId, boolean enabled)Enables or disables descriptor with specified id in build configuration settings.voidsetExternalId(String newExternalId)Changes the external id of this build template or build configuration.voidsetExternalId(ConfigAction cause, String newExternalId)Changes the external id of this build template or build configuration.voidsetExternalId(ConfigAction configAction, String newId, boolean sendEvents)Same as {BuildTypeIdentity.setExternalId(ConfigAction, String)} but provides control over events processing.voidsetName(String newName)Sets name of this build type or template<T> voidsetOption(Option<T> option, T value)Set option value, clears value if it is the same as defaultvoidsetPaused(boolean paused, User user)Pause/unpause this build configuration.voidsetPaused(boolean paused, User user, String comment)Pause/unpause this build configuration.voidsetResponsible(User responsibleUser, String userComment, User reporterUser)Called when a user takes a responsibility for the build type.voidsetSettings(BuildTypeSettingsEx newSettings)Complete replacement of settingsvoidsetTemplates(List<? extends BuildTypeTemplate> templates, boolean optimizeSettings)Replaces templates the build configuration is attached to.voidsetTemplatesOrder(List<String> templatesOrder)Imposes new order on the templates the build configuration is attached to.booleansetVcsRoots(Collection<SVcsRoot> vcsRoots)Sets VCS roots.booleantextValueMatches(Pattern regexpPattern)Returns true if configuration has value in text parameters which matches specified pattern.voidtraverseDependedOnMe(DependencyConsumer<BuildTypeEx> consumer)voidtraverseDependencies(DependencyConsumer<BuildTypeEx> consumer)voidtraverseSelfAndDependedOnMe(DependencyConsumer<BuildTypeEx> consumer)voidtraverseSelfAndDependencies(DependencyConsumer<BuildTypeEx> consumer)voidunregister()Must be called when this build configuration was removed from the project completely (calls dispose too).booleanupdateBuildFeature(String featureId, String newType, Map<String,String> newParams)Updates build feature descriptor with specified id, changes type and parameters.booleanupdateBuildRunner(String runnerId, String name, String type, Map<String,String> params)Updates parameters in the existing build runner descriptor.booleanupdateBuildTrigger(String triggerId, String newType, Map<String,String> newParams)Updates build trigger descriptor with specified id, changes type and parameters.booleanupdateBuildTrigger(BuildTriggerDescriptor newDescriptor)Updates build trigger descriptor with id equal to newDescriptor id.voidupdateRevisionsForOwnBranches(Collection<String> logicalBranchNames)Make sure that revisions for specified logical branches are calculated and saved in dummy build promotions.-
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.BuildTypeEx
getDeclaredOption, getTypedOption
-
Methods inherited from interface jetbrains.buildServer.serverSide.InheritableUserParametersHolderEx
getOwnAndParentsNonInheritedParameter, getOwnAndParentsNonInheritedParameters
-
Methods inherited from interface jetbrains.buildServer.serverSide.InternalParameters
getBooleanInternalParameter, getBooleanInternalParameterOrTrue, getInternalParameterValue
-
-
-
-
Constructor Detail
-
DummyBuildType
public DummyBuildType(@NotNull BuildTypeSettingsEx buildTypeSettings, @NotNull BranchSpec specs, @NotNull VcsRootInstancesManagerEx vcsRootInstancesManager, @NotNull BuildPromotionManagerEx promotionManager)
-
-
Method Detail
-
getEntityId
@NotNull public EntityId<String> getEntityId()
Description copied from interface:BuildTypeIdentityExReturns the instance of the entity identifier.This instance (not a copy!) that contains immutable internal id and modifiable external id. When one has changed the external id of this build template or configuration, the external id incide this class instance will be changed too.
- Specified by:
getEntityIdin interfaceBuildTypeIdentityEx- Returns:
- the instance of the entity identifier.
-
getInternalId
@NotNull public String getInternalId()
Description copied from interface:BuildTypeIdentityReturns the internal identifier.- Specified by:
getInternalIdin interfaceBuildTypeIdentity- Returns:
- the internal identifier.
-
getName
@NotNull public String getName()
Description copied from interface:BuildTypeIdentityThe name of the identity.- Specified by:
getNamein interfaceBuildTypeDescriptor- Specified by:
getNamein interfaceBuildTypeIdentity- Specified by:
getNamein interfaceLVcsRootInstanceHolder- Specified by:
getNamein interfaceSPersistentEntity- Returns:
- see above.
- See Also:
BuildTypeIdentity.getFullName(),BuildTypeIdentity.setName(String)
-
getFullName
@NotNull public String getFullName()
Description copied from interface:BuildTypeIdentityName of the project and name of the identity.- Specified by:
getFullNamein interfaceBuildTypeDescriptor- Specified by:
getFullNamein interfaceBuildTypeIdentity- Returns:
- see above
- See Also:
BuildTypeIdentity.getName()
-
getDescription
public String getDescription()
Description copied from interface:BuildTypeDescriptorReturns configuration description.- Specified by:
getDescriptionin interfaceBuildTypeDescriptor- Returns:
- configuration description.
-
getBuildTypeId
@NotNull public String getBuildTypeId()
Description copied from interface:BuildTypeDescriptorReturns build configuration internal id. Cannot be changed.- Specified by:
getBuildTypeIdin interfaceBuildTypeDescriptor- Specified by:
getBuildTypeIdin interfaceLVcsRootInstanceHolder- Returns:
- unique id
-
getConfigId
@NotNull public String getConfigId()
Description copied from interface:SPersistentEntityReturns the entity's config identifier. Config identifier uniquely identifies the entity across different TeamCity servers and can't be modified in contrast to external identifier.- Specified by:
getConfigIdin interfaceSPersistentEntity
-
getExternalId
@NotNull public String getExternalId()
Description copied from interface:BuildTypeIdentityReturns the external identifier.- Specified by:
getExternalIdin interfaceBuildTypeDescriptor- Specified by:
getExternalIdin interfaceBuildTypeIdentity- Specified by:
getExternalIdin interfaceSPersistentEntity- Returns:
- the external identifier.
-
getProjectName
@NotNull public String getProjectName()
Description copied from interface:BuildTypeDescriptorReturns project name this configuration belongs to.- Specified by:
getProjectNamein interfaceBuildTypeDescriptor- Returns:
- parent project name.
-
getImplicitRequirements
@NotNull public List<Requirement> getImplicitRequirements()
Description copied from interface:BuildTypeSettingsGet list of non-satisfied implicit requirements for build agents. Implicit requirements appear when some build configuration property, or run parameter contains a reference to another parameter in form %<param name>%.- Specified by:
getImplicitRequirementsin interfaceBuildTypeSettings- Returns:
- see above
-
getHistory
public List<SFinishedBuild> getHistory()
Description copied from interface:SBuildType- Specified by:
getHistoryin interfaceSBuildType- Returns:
- all non-cancelled builds non-personal builds for this build configuration, ordered by build start time descending (recent first)
-
getHistoryFull
public List<SFinishedBuild> getHistoryFull(boolean orderByChanges)
Description copied from interface:SBuildType- Specified by:
getHistoryFullin interfaceSBuildType- Parameters:
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- Returns:
- all (including cancelled and personal builds) for this build configuration, ordered according to orderByChanges parameter.
-
getHistory
public List<SFinishedBuild> getHistory(@Nullable User user, boolean includeCanceled, boolean orderByChanges)
Description copied from interface:SBuildTypeReturns all finished builds, visible for the specified user of this configuration.- Specified by:
getHistoryin interfaceSBuildType- Parameters:
user- specified user. If user isnullno 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- Returns:
- list of all finished builds sorted according to orderByChanges field.
-
getLastChangesStartedBuild
public SBuild getLastChangesStartedBuild()
Description copied from interface:SBuildTypeReturns instance of the build, finished or running, which contains latest changes in this build configuration- Specified by:
getLastChangesStartedBuildin interfaceSBuildType- Returns:
- build with latest changes
-
getAgentCompatibilities
public List<AgentCompatibility> getAgentCompatibilities()
Description copied from interface:SBuildTypeReturns information about what agent are compatible with the configuration, what are incompatible and why.AgentCompatibilityare provided for all authorized agents.- Specified by:
getAgentCompatibilitiesin interfaceSBuildType- Returns:
- list of compatibility information holders.
-
getAgentCompatibility
public AgentCompatibility getAgentCompatibility(@NotNull SBuildAgent agent)
Description copied from interface:SBuildTypeReturns information about agent compatibility for the specified agent.- Specified by:
getAgentCompatibilityin interfaceSBuildType- Parameters:
agent- the given agent.- Returns:
- agent compatibility for the specified agent.
-
getAgentTypeCompatibility
@NotNull public AgentCompatibility getAgentTypeCompatibility(@NotNull SAgentType agentType)
- Specified by:
getAgentTypeCompatibilityin interfaceBuildTypeEx
-
getCanRunAndCompatibleAgentTypes
public List<StartableAgentType> getCanRunAndCompatibleAgentTypes()
Description copied from interface:BuildTypeExReturns list of cloud agent types which are both allowed to run this configuration and are compatible with it.- Specified by:
getCanRunAndCompatibleAgentTypesin interfaceBuildTypeEx- Returns:
- list of cloud agent types which are both allowed to run this configuration and are compatible with it.
-
getDependencyGraph
@NotNull public BuildTypeDependencyGraph getDependencyGraph()
- Specified by:
getDependencyGraphin interfaceBuildTypeEx- Returns:
- graph of snapshot dependencies assuming this build configuration is a top one.
-
findTops
@NotNull public Collection<BuildTypeEx> findTops()
- Specified by:
findTopsin interfaceBuildTypeEx- Returns:
- all topmost build configurations having direct or transitive snapshot dependency on this build configuration. If there are no such build configurations returns itself.
-
getAgentCompatibility
@NotNull public CompatibilityResult getAgentCompatibility(@NotNull AgentDescription agentDescription)
Description copied from interface:CompatibleAgentsFetches compatibility information for given agent description- Specified by:
getAgentCompatibilityin interfaceCompatibleAgents- Parameters:
agentDescription- agent description- Returns:
- compatibility results.
- See Also:
CompatibilityResult
-
getCompatibilityMap
@NotNull public Map<SBuildAgent,CompatibilityResult> getCompatibilityMap()
Description copied from interface:CompatibleAgentsReturns compatibility map, key is an agent and value is compatibility result.- Specified by:
getCompatibilityMapin interfaceCompatibleAgents- Returns:
- see above
-
getCompatibleAgents
@NotNull public Collection<SBuildAgent> getCompatibleAgents()
Description copied from interface:CompatibleAgentsReturns collection of compatible agents- Specified by:
getCompatibleAgentsin interfaceCompatibleAgents- Returns:
- see above
-
processHistoryEntries
public void processHistoryEntries(@NotNull ItemProcessor<SFinishedBuild> itemProcessor)Description copied from interface:BuildTypeExInvokes the given ItemProcessor for all history records of this build type. Entries are pushed into the processor in changes order.- Specified by:
processHistoryEntriesin interfaceBuildTypeEx- Parameters:
itemProcessor- processor for history entries
-
getCanRunAgents
public List<BuildAgentEx> getCanRunAgents()
Description copied from interface:SBuildTypeReturns list of agents where this build configuration can run. Build configuration can run on an agent if this agent is authorized and if agent run policyBuildAgentManager.RunConfigurationPolicyallows to run this build configuration. Note that this method does not consider agent pool associations.- Specified by:
getCanRunAgentsin interfaceSBuildType- Returns:
- list of agents where this build configuration can run sorted by agent name
-
getCanRunAndCompatibleAgents
public List<BuildAgentEx> getCanRunAndCompatibleAgents(boolean includeDisabled)
Description copied from interface:SBuildTypeReturns list of agents which are both allowed to run this configuration and are compatible with it.- Specified by:
getCanRunAndCompatibleAgentsin interfaceSBuildType- Parameters:
includeDisabled- true to include disabled agents in the list, by default they are excluded- Returns:
- list of agents which are both allowed to run this configuration and are compatible with it.
-
getBuildNumbers
public BuildNumbers getBuildNumbers()
Description copied from interface:SBuildTypeReturns interface to manipulate current build counter- Specified by:
getBuildNumbersin interfaceSBuildType- Returns:
- see above
-
getRunningBuilds
@NotNull public List<SRunningBuild> getRunningBuilds(@Nullable User user)
Description copied from interface:SBuildType- Specified by:
getRunningBuildsin interfaceBuildType- Specified by:
getRunningBuildsin interfaceSBuildType- Parameters:
user- owner of personal builds- Returns:
- list of running builds
-
getRunningBuilds
@NotNull public List<SRunningBuild> getRunningBuilds()
Description copied from interface:SBuildTypeSame as getRunningBuilds(null)- Specified by:
getRunningBuildsin interfaceBuildType- Specified by:
getRunningBuildsin interfaceSBuildType- Returns:
- list of running builds
-
getLastChangesFinished
public SFinishedBuild getLastChangesFinished()
Description copied from interface:BuildTypeReturns last finished instance for the build configuration with last user changes (personal builds and canceled builds are excluded).- Specified by:
getLastChangesFinishedin interfaceBuildType- Specified by:
getLastChangesFinishedin interfaceSBuildType- Returns:
- last finished build (ordered by changes) from the default branch.
-
getLastChangesSuccessfullyFinished
public SFinishedBuild getLastChangesSuccessfullyFinished()
Description copied from interface:BuildTypeReturns last successfully finished build in the configuration with last user changes, personal builds are not considered- Specified by:
getLastChangesSuccessfullyFinishedin interfaceBuildType- Specified by:
getLastChangesSuccessfullyFinishedin interfaceSBuildType- Returns:
- last successfully finished build (ordered by changes) from the default branch.
-
setPaused
public void setPaused(boolean paused, User user)Description copied from interface:SBuildTypePause/unpause this build configuration. Paused build configuration is not triggered by VCS check-ins and time triggers.- Specified by:
setPausedin interfaceSBuildType- Parameters:
paused- if configuration should be pauseduser- use who is pausing the configuration
-
setPaused
public void setPaused(boolean paused, User user, String comment)Description copied from interface:SBuildTypePause/unpause this build configuration. Paused build configuration is not triggered by VCS check-ins and time triggers.- Specified by:
setPausedin interfaceSBuildType- Parameters:
paused- if configuration should be pauseduser- use who is pausing the configurationcomment- user comment
-
getPauseComment
public Comment getPauseComment()
Description copied from interface:SBuildTypeReturns comment for pausing/resuming this build type- Specified by:
getPauseCommentin interfaceSBuildType- Returns:
- comment for pausing/resuming this build type
-
getLastPauseComment
@Nullable public Comment getLastPauseComment()
Description copied from interface:BuildTypeExDiffers fromSBuildType.getPauseComment()- it returns last comment for pause action only.- Specified by:
getLastPauseCommentin interfaceBuildTypeEx- Returns:
-
getSourceBuildType
@NotNull public SBuildType getSourceBuildType()
Description copied from interface:BuildTypeExIf current instance is an instance of RemoteBuildType - returns base configuration for remote build type, otherwise - returns this.- Specified by:
getSourceBuildTypein interfaceBuildTypeEx- Specified by:
getSourceBuildTypein interfaceLVcsRootInstanceHolderEx- Returns:
- see below.
-
getProject
@NotNull public ProjectEx getProject()
Description copied from interface:BuildTypeIdentityReturns the project this build type entity belongs to.- Specified by:
getProjectin interfaceBuildTypeEx- Specified by:
getProjectin interfaceBuildTypeIdentity- Specified by:
getProjectin interfaceBuildTypeSettings- Specified by:
getProjectin interfaceSBuildType- Returns:
- the project this build type entity belongs to.
-
newRunningBuild
@NotNull public RunningBuildEx newRunningBuild(@NotNull QueuedBuildEx queuedBuild, @Nullable SBuildAgent buildAgent, @NotNull Date removeFromQueueTime)
Description copied from interface:BuildTypeExCreates new SRunningBuild instance.- Specified by:
newRunningBuildin interfaceBuildTypeEx- Parameters:
queuedBuild- source queued buildbuildAgent- agent the build will be running on or null if build is agent lessremoveFromQueueTime- time when build was removed from the queue- Returns:
- the new running build
-
newAgentLessBuild
@NotNull public RunningBuildEx newAgentLessBuild(@NotNull QueuedBuildEx queuedBuild, @Nullable SBuildAgent buildAgent, @NotNull Date removeFromQueueTime)
Description copied from interface:BuildTypeExCreates new SRunningBuild instance and sets executor name as a build promotion attribute for the purposes of Executor mode builds.- Specified by:
newAgentLessBuildin interfaceBuildTypeEx- Parameters:
queuedBuild- source queued buildbuildAgent- agent the build will be running on or null if build is agent lessremoveFromQueueTime- time when build was removed from the queue- Returns:
- the new running build
-
attachedToModel
public void attachedToModel(@NotNull ProjectDataModel model)- Specified by:
attachedToModelin interfaceBuildTypeEx
-
createBuildPromotion
@NotNull public BuildPromotionEx createBuildPromotion()
Description copied from interface:BuildTypeExCreates new build promotion which then can be used when build is added to a queue. Build promotion holds necessary information to reproduce a build. If build configuration has source dependencies on other build configurations, the whole graph is constructed and the top node of this graph (corresponding to this build configuration) is returned.- Specified by:
createBuildPromotionin interfaceBuildTypeEx- Returns:
- newly created build promotion.
-
createBuildPromotion
@NotNull public BuildPromotionEx createBuildPromotion(@NotNull String branchName)
Description copied from interface:BuildTypeExCreates build promotion graph and sets specified branch name to all its nodes.- Specified by:
createBuildPromotionin interfaceBuildTypeEx- Parameters:
branchName- name of the branch- Returns:
- newly created build promotion.
-
createBuildPromotion
@NotNull public BuildPromotionEx createBuildPromotion(@NotNull String branchName, @Nullable BuildPromotionInitializer initializer)
Description copied from interface:BuildTypeExSame asBuildTypeEx.createBuildPromotion(String)but accepts initializer which is called for every new build promotion in the created build chain- Specified by:
createBuildPromotionin interfaceBuildTypeEx- Returns:
-
createBuildPromotion
public BuildPromotionEx createBuildPromotion(@Nullable String branchName, @Nullable BuildPromotionInitializer initializer, @Nullable DependenciesSupplier dependenciesSupplier)
Description copied from interface:BuildTypeExSame asBuildTypeEx.createBuildPromotion(String)but accepts initializer and dependencies supplier. Initializer is called for every new build promotion in the created build chain, while dependencies supplier is used to fetch dependencies of the current node while the build chain is constructed.- Specified by:
createBuildPromotionin interfaceBuildTypeEx- Returns:
-
createBuildCustomizer
@NotNull public BuildCustomizer createBuildCustomizer(@Nullable SUser user)
Description copied from interface:BuildTypeExCreatesBuildCustomizerthat can be used to create custom promotions for this build type- Specified by:
createBuildCustomizerin interfaceBuildTypeEx
-
createPersonalBuildType
@NotNull public RemoteBuildTypeEx createPersonalBuildType(@NotNull User user, @Nullable String comment)
Description copied from interface:BuildTypeExCreates personal build type, i.e. build type which is used to start personal builds.- Specified by:
createPersonalBuildTypein interfaceBuildTypeEx- Parameters:
user- personal build type ownercomment- personal comment- Returns:
- new personal build type
-
createPersonalBuildType
@NotNull public RemoteBuildTypeEx createPersonalBuildType(@NotNull User user, long changeListId)
Description copied from interface:BuildTypeExCreates personal build type, i.e. build type which is used to start personal builds.- Specified by:
createPersonalBuildTypein interfaceBuildTypeEx- Parameters:
user- personal build type ownerchangeListId- id of the personal change list (must be published separately)- Returns:
- new personal build type
-
createPersonalBuildType
@NotNull public RemoteBuildTypeEx createPersonalBuildType(@NotNull User user, @Nullable String comment, @NotNull Map<VcsRootInstance,VcsRootInstance> overridenRoots)
Description copied from interface:BuildTypeExCreate personal build type that starts build with overriden roots. If there are snapshot dependencies, personal builds will be created for those nodes where overridden roots are applicable.- Specified by:
createPersonalBuildTypein interfaceBuildTypeEx- Parameters:
user- personal build type ownercomment- personal commentoverridenRoots- overriden roots map (original root -> substitution root)- Returns:
- new personal build type
-
addToQueue
public SQueuedBuild addToQueue(@NotNull BuildPromotionEx buildPromotion, @NotNull String triggeredBy)
Description copied from interface:BuildTypeExAdds build to queue with specified build promotion. Build promotion contains various settings necessary to run a build, like build parameters, build revisions and so on.- Specified by:
addToQueuein interfaceBuildTypeEx- Parameters:
buildPromotion- build promotiontriggeredBy- who added build to queue- Returns:
- new queued build instance if there is no instances of this configuration in the queue, or previously added instance otherwise.
-
addToQueue
public SQueuedBuild addToQueue(@NotNull SAgentRestrictor agentRestrictor, @NotNull BuildPromotionEx buildPromotion, @NotNull String triggeredBy)
Description copied from interface:BuildTypeExAdds build to queue on the specified agent with manually set build parameters: these build parameters will redefined build parameters specified within this build configuration- Specified by:
addToQueuein interfaceBuildTypeExbuildPromotion- build promotiontriggeredBy- who added build to queue- Returns:
- new queued build instance if there is no instances of this configuration in the queue, or previously added instance otherwise.
-
getSettings
@NotNull public BuildTypeSettingsEx getSettings()
- Specified by:
getSettingsin interfaceBuildTypeEx- Specified by:
getSettingsin interfaceBuildTypeIdentityEx- Returns:
- Underlying build settings object
-
dispose
public void dispose()
Description copied from interface:BuildTypeExMust be called when this build configuration object is removed from the model.- Specified by:
disposein interfaceBuildTypeEx
-
remove
public void remove()
Description copied from interface:SPersistentEntityRemoves this entity.This method also makes all changes (related to removing the entity) on the disk and in the database. There is no need to call the persist() after this method.
- Specified by:
removein interfaceSPersistentEntity
-
unregister
public void unregister()
Description copied from interface:BuildTypeExMust be called when this build configuration was removed from the project completely (calls dispose too).- Specified by:
unregisterin interfaceBuildTypeEx- Specified by:
unregisterin interfaceBuildTypeIdentityEx
-
setExternalId
public void setExternalId(@NotNull ConfigAction configAction, @NotNull String newId, boolean sendEvents) throws InvalidIdentifierException, DuplicateExternalIdException, ObsoleteEntityExceptionDescription copied from interface:BuildTypeIdentityExSame as {BuildTypeIdentity.setExternalId(ConfigAction, String)} but provides control over events processing. If parameter sendEvents is false, then no events about changing of the external id will be sent. This mode can be useful if the events will be sent later, for instance, in case of bulk edit ids operation.- Specified by:
setExternalIdin interfaceBuildTypeIdentityEx- Throws:
InvalidIdentifierExceptionDuplicateExternalIdExceptionObsoleteEntityException
-
sendExtIdChangedEvents
public void sendExtIdChangedEvents(@NotNull ConfigAction cause, @NotNull String oldExternalId, @NotNull String newExternalId)Description copied from interface:BuildTypeIdentityExThis method can be used to send external id changed event.- Specified by:
sendExtIdChangedEventsin interfaceBuildTypeIdentityEx
-
isTemplateAccessible
public boolean isTemplateAccessible()
Description copied from interface:BuildTypeSettingsChecks accessibility of all attached templates, excluding the default template (if present)- Specified by:
isTemplateAccessiblein interfaceBuildTypeSettings- Returns:
- true if there are such templates and all of them are accessible to currently logged in user, false otherwise
-
replaceInValues
public boolean replaceInValues(@NotNull Pattern regexpPattern, @NotNull String replacement)Description copied from interface:BuildTypeSettingsReplaces values according to specified pattern and replacement string in all text parameters of the build configuration- Specified by:
replaceInValuesin interfaceBuildTypeSettings- Parameters:
regexpPattern- regexp patternreplacement- replacement- Returns:
- true if at least one text value was affected and false otherwise
-
textValueMatches
public boolean textValueMatches(@NotNull Pattern regexpPattern)Description copied from interface:BuildTypeSettingsReturns true if configuration has value in text parameters which matches specified pattern. Only own parameters are checked - without inherited- Specified by:
textValueMatchesin interfaceBuildTypeSettings- Parameters:
regexpPattern- regexp pattern- Returns:
- true if such value exists and false otherwise
-
setName
public void setName(@NotNull String newName) throws DuplicateBuildTypeNameException, BuildTypeRenamingFailedExceptionDescription copied from interface:BuildTypeIdentitySets name of this build type or template- Specified by:
setNamein interfaceBuildTypeIdentity- Specified by:
setNamein interfaceSBuildType- Parameters:
newName- the new name- Throws:
DuplicateBuildTypeNameException- if another build configuration with such name exists in the build configuration projectBuildTypeRenamingFailedException- if build configuration renaming failed- See Also:
BuildTypeIdentity.getName(),BuildTypeIdentity.getFullName()
-
setDescription
public void setDescription(@Nullable String description)Description copied from interface:SBuildTypeChanges configuration description.- Specified by:
setDescriptionin interfaceSBuildType- Parameters:
description- new configuration description.
-
getArtifactsReferences
public List<SBuildType> getArtifactsReferences()
Description copied from interface:SBuildTypeReturns list of build configurations which depend on this build configurations artifacts- Specified by:
getArtifactsReferencesin interfaceSBuildType- Returns:
- list of build configurations
-
getNumberOfArtifactReferences
public int getNumberOfArtifactReferences()
Description copied from interface:SBuildTypeReturns number of dependent build configuration having references to this build configuration. This number may be greater than the size of the listSBuildType.getArtifactsReferences()because it takes into account all dependent build configurations whileSBuildType.getArtifactsReferences()returns only build configurations accessible to an authority currently set in the security context.- Specified by:
getNumberOfArtifactReferencesin interfaceSBuildType- Returns:
- see above
-
getArtifactsDirectory
@NotNull public File getArtifactsDirectory()
Description copied from interface:SBuildTypeReturns directory containing artifacts of this build configuration.- Specified by:
getArtifactsDirectoryin interfaceSBuildType- Returns:
- artifacts directory on the server.
-
getPendingChanges
public List<SVcsModification> getPendingChanges()
Description copied from interface:SBuildTypeReturns changes in this build configuration already detected but not associated with a build. Only own changes are returned ignoring changes from dependencies option.- Specified by:
getPendingChangesin interfaceBuildType- Specified by:
getPendingChangesin interfaceSBuildType- Returns:
- list of version control modifications, which are detected but no build with these modifications is created yet.
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy policy)
- Specified by:
getDetectedChangesin interfaceBuildTypeEx
-
getDetectedChanges
@NotNull public List<ChangeDescriptor> getDetectedChanges(@NotNull SelectPrevBuildPolicy prevBuildPolicy, @Nullable Boolean includeDependencyChanges)
- Specified by:
getDetectedChangesin interfaceBuildTypeEx
-
getRawDependedOnMe
@NotNull public Map<String,DependencyOptions> getRawDependedOnMe()
Description copied from interface:BuildTypeExMap from internal build type id to dependency options- Specified by:
getRawDependedOnMein interfaceBuildTypeEx- Returns:
-
getDependedOnMe
@NotNull public Map<SBuildType,DependencyOptions> getDependedOnMe()
- Specified by:
getDependedOnMein interfaceBuildTypeEx- Returns:
- same as
BuildTypeEx.getRawDependedOnMe()but with actual build types.
-
getTransitiveDependedOnMe
@NotNull public List<SBuildType> getTransitiveDependedOnMe()
Description copied from interface:BuildTypeExReturns all build configurations collected up the dependency chain. Note that returned dependencies are sorted by the distance from this build type. The returned list is filtered by current user permissions and may contain not all references.- Specified by:
getTransitiveDependedOnMein interfaceBuildTypeEx
-
traverseDependedOnMe
public void traverseDependedOnMe(@NotNull DependencyConsumer<BuildTypeEx> consumer)- Specified by:
traverseDependedOnMein interfaceBuildTypeEx
-
traverseDependencies
public void traverseDependencies(@NotNull DependencyConsumer<BuildTypeEx> consumer)- Specified by:
traverseDependenciesin interfaceBuildTypeEx
-
traverseSelfAndDependencies
public void traverseSelfAndDependencies(@NotNull DependencyConsumer<BuildTypeEx> consumer)- Specified by:
traverseSelfAndDependenciesin interfaceBuildTypeEx
-
traverseSelfAndDependedOnMe
public void traverseSelfAndDependedOnMe(@NotNull DependencyConsumer<BuildTypeEx> consumer)- Specified by:
traverseSelfAndDependedOnMein interfaceBuildTypeEx
-
getBranches
@NotNull public List<BranchEx> getBranches(@NotNull BranchesPolicy policy, @Nullable Boolean includeBranchesFromDependencies)
- Specified by:
getBranchesin interfaceBuildTypeEx
-
getBranches
@NotNull public List<BranchEx> getBranches(@NotNull BranchesPolicy policy, @Nullable Boolean includeBranchesFromDependencies, boolean computeTimestamps)
- Specified by:
getBranchesin interfaceBuildTypeEx
-
getBranches
@NotNull public List<BranchEx> getBranches(@NotNull BranchCalculationOptions branchCalculationOptions)
- Specified by:
getBranchesin interfaceBuildTypeEx
-
getBranch
@NotNull public BranchEx getBranch(@NotNull String name)
- Specified by:
getBranchin interfaceBuildTypeEx
-
isValidVcsBranch
public boolean isValidVcsBranch(@NotNull String name, boolean includeBranchesFromDependencies)- Specified by:
isValidVcsBranchin interfaceBuildTypeEx
-
getOwnVcsBranchNames
@NotNull public Collection<String> getOwnVcsBranchNames(boolean activeOnly)
- Specified by:
getOwnVcsBranchNamesin interfaceBuildTypeEx
-
hasOwnBranches
public boolean hasOwnBranches()
- Specified by:
hasOwnBranchesin interfaceBuildTypeEx
-
getActiveBranches
@NotNull public List<BranchEx> getActiveBranches()
- Specified by:
getActiveBranchesin interfaceBuildTypeEx
-
getBuildTypeOrderedBuilds
@NotNull public BuildTypeOrderedBuilds getBuildTypeOrderedBuilds()
- Specified by:
getBuildTypeOrderedBuildsin interfaceBuildTypeEx
-
getPendingChangesCommitters
public Collection<SUser> getPendingChangesCommitters()
Description copied from interface:SBuildTypeReturns pending changes committers to this build configuration- Specified by:
getPendingChangesCommittersin interfaceSBuildType- Returns:
- see above
-
getModificationsSinceLastSuccessful
public List<SVcsModification> getModificationsSinceLastSuccessful()
Description copied from interface:SBuildTypeReturns all modifications made since last successfully finished build- Specified by:
getModificationsSinceLastSuccessfulin interfaceBuildType- Specified by:
getModificationsSinceLastSuccessfulin interfaceSBuildType- Returns:
- list of version control modifications, detected since last successful finished build has been finished
-
getBranchSpec
@NotNull public BranchSpec getBranchSpec(@NotNull LVcsRootInstance root)
- Specified by:
getBranchSpecin interfaceLVcsRootInstanceHolderEx
-
getBranchSpec
@NotNull public BranchSpec getBranchSpec(@NotNull SVcsRoot root)
Description copied from interface:BuildTypeExReturns branch specification for specified parent root- Specified by:
getBranchSpecin interfaceBuildTypeEx- Parameters:
root- root of interest- Returns:
- see above
-
getLastUsedBranchSpecMap
@NotNull public Map<VcsRootInstance,BranchSpec> getLastUsedBranchSpecMap()
- Specified by:
getLastUsedBranchSpecMapin interfaceBuildTypeEx
-
getLastUsedBranchSpecMap
@NotNull public Map<VcsRootInstance,BranchSpec> getLastUsedBranchSpecMap(boolean includeSettingsRoot)
- Specified by:
getLastUsedBranchSpecMapin interfaceBuildTypeEx
-
getAdditionalBranchSpecs
@NotNull public List<BranchSpec> getAdditionalBranchSpecs(@NotNull LVcsRootInstance root, @NotNull VcsRepositoryState state)
- Specified by:
getAdditionalBranchSpecsin interfaceLVcsRootInstanceHolderEx
-
getAdditionalBranchesForChangesCollecting
@NotNull public Set<String> getAdditionalBranchesForChangesCollecting(@NotNull LVcsRootInstance root, @NotNull VcsRepositoryState state)
- Specified by:
getAdditionalBranchesForChangesCollectingin interfaceLVcsRootInstanceHolderEx
-
getBranchSpec
@NotNull public BranchSpec getBranchSpec(@NotNull VcsRootInstance root)
- Specified by:
getBranchSpecin interfaceBuildTypeEx
-
getLastUsedBranchSpec
@NotNull public BranchSpec getLastUsedBranchSpec(@NotNull SVcsRoot parentRoot)
Description copied from interface:BuildTypeExReturns branch specification used for changes collecting in given VCS root. If changes are not collected yet returns current value of branch specification.- Specified by:
getLastUsedBranchSpecin interfaceBuildTypeEx- Parameters:
parentRoot- root of interest- Returns:
- see above
-
rememberLastUsedRootInstanceAndBranchSpec
public boolean rememberLastUsedRootInstanceAndBranchSpec(@NotNull LVcsRootInstance rootInst, @NotNull BranchSpec spec)Description copied from interface:LVcsRootInstanceHolderExStores branch specification used for changes collecting in given VCS root and resets a pending changes cache if root or spec is changed since last call to this method or whenforcePendingChangesResetis true- Specified by:
rememberLastUsedRootInstanceAndBranchSpecin interfaceLVcsRootInstanceHolderExspec- branch specification- Returns:
- true if buildType's caches were updated
-
branchesChanged
public void branchesChanged(boolean currentNodeEvent, @NotNull Date branchChangeTimestamp)Description copied from interface:LVcsRootInstanceHolderExNotifies build configuration that the branches may have changed.- Specified by:
branchesChangedin interfaceLVcsRootInstanceHolderExbranchChangeTimestamp- the time when the branches were changed (usually this is the time when we started collecting changes)
-
getAdditionalBranchSpecs
@NotNull public List<BranchSpec> getAdditionalBranchSpecs(@NotNull VcsRootInstance root, @NotNull VcsRepositoryState state)
- Specified by:
getAdditionalBranchSpecsin interfaceBuildTypeEx
-
isBranchSpecDefined
public boolean isBranchSpecDefined(boolean processDependencies)
- Specified by:
isBranchSpecDefinedin interfaceBuildTypeEx- Parameters:
processDependencies- whether to process snapshot dependencies or not- Returns:
- true if at least one vcs root in build configuration or its dependencies has VCS root with non empty branch spec
-
isBranchSpecDefined
public boolean isBranchSpecDefined(boolean processDependencies, boolean processSettingsRoot)- Specified by:
isBranchSpecDefinedin interfaceBuildTypeEx
-
clearPrevPromotionCache
public void clearPrevPromotionCache(@Nullable Collection<BuildPromotion> targetPromos)- Specified by:
clearPrevPromotionCachein interfaceBuildTypeEx
-
getBuildTriggerDescriptors
@NotNull public Collection<BuildTriggerDescriptor> getBuildTriggerDescriptors(@NotNull String triggerName, boolean enabledOnly)
- Specified by:
getBuildTriggerDescriptorsin interfaceBuildTypeEx- Parameters:
triggerName- name of the triggerenabledOnly- whether to return only enabled triggers or all- Returns:
- build triggers of specified type
-
getResolvedBuildTriggerDescriptors
@NotNull public Collection<BuildTriggerDescriptor> getResolvedBuildTriggerDescriptors(boolean enabledOnly)
- Specified by:
getResolvedBuildTriggerDescriptorsin interfaceBuildTypeEx- Parameters:
enabledOnly- whether to return only enabled triggers or all- Returns:
- build triggers with resolved settings.
-
getResolvedBuildTriggerDescriptors
@NotNull public Collection<BuildTriggerDescriptor> getResolvedBuildTriggerDescriptors(@NotNull String triggerName, boolean enabledOnly)
- Specified by:
getResolvedBuildTriggerDescriptorsin interfaceBuildTypeEx- Parameters:
triggerName- name of the triggerenabledOnly- whether to return only enabled triggers or all- Returns:
- build triggers of specified type with fully resolved settings.
-
getPendingChangesInAllBranches
@NotNull public List<ChangeDescriptor> getPendingChangesInAllBranches(@Nullable Boolean includeDependencyChanges)
Description copied from interface:BuildTypeExReturns pending changes detected in all branches of this build configuration.- Specified by:
getPendingChangesInAllBranchesin interfaceBuildTypeEx- Returns:
- list of pending changes.
-
getPendingChangesInAllBranches
@NotNull public List<ChangeDescriptor> getPendingChangesInAllBranches(@Nullable Boolean includeDependencyChanges, @NotNull VcsModificationProcessor callback)
- Specified by:
getPendingChangesInAllBranchesin interfaceBuildTypeEx
-
getQueuedBuilds
@NotNull public List<SQueuedBuild> getQueuedBuilds()
- Specified by:
getQueuedBuildsin interfaceBuildTypeEx
-
getLatestBuilds
@NotNull public List<SBuild> getLatestBuilds()
- Specified by:
getLatestBuildsin interfaceBuildTypeEx- Returns:
- latest builds (currently running and last finished)
-
getVcsSettingsHash
@NotNull public String getVcsSettingsHash(@NotNull List<VcsRootInstanceEntry> vcsRootEntries)
Description copied from interface:SBuildTypeReturn name of the directory which should be used as checkout directory for this build configuration if explicit checkout directory is not specified. In fact, this name is a generated hash which depends on VCS Roots associated with this build configuration and some other settings, such as CheckoutTypeBuildTypeDescriptor.getCheckoutType()and checkout rulesBuildTypeSettings.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.- Specified by:
getVcsSettingsHashin interfaceSBuildType- Parameters:
vcsRootEntries- vcs roots with checkout rules to get name hash for.- Returns:
- name of the directory which will be used as last part of checkout directory
- See Also:
BuildTypeSettings.setCheckoutDirectory(String)
-
getVcsSettingsHash
@NotNull public String getVcsSettingsHash()
Description copied from interface:SBuildTypeReturns build configuration vcs settings hash.
Note: be careful, when using this value for running build. Build type might already be updated 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.- Specified by:
getVcsSettingsHashin interfaceSBuildType- Returns:
- see above
-
getVcsRootsHash
@NotNull public String getVcsRootsHash()
Description copied from interface:SBuildTypeReturns build configuration vcs roots hash without taking checkout directory into account
The resulting hash is an equal to the default checkout directory (since 10.0 it is true only for not auto checkout type). Note: be careful, when using this value for running build. Build type might already be updated 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.- Specified by:
getVcsRootsHashin interfaceSBuildType- Returns:
- see above
-
getVcsRootsHash
@NotNull public String getVcsRootsHash(BuildTypeDescriptor.CheckoutType checkoutType)
Description copied from interface:BuildTypeExReturns build configuration vcs roots hash without taking checkout directory into account
The resulting hash is an equal to the default checkout directory. Note: be careful, when using this value for running build. Build type might already be updated It's a replacement for deprecatedSBuildType.getVcsRootsHash()- returns hash of vcs roots as if specified checkoutType is used. Don't acceptBuildTypeDescriptor.CheckoutType.AUTO, throwsIllegalArgumentExceptionif passed.- Specified by:
getVcsRootsHashin interfaceBuildTypeEx
-
releaseSources
public void releaseSources()
Description copied from interface:SBuildTypeReleases sources of the build configuration on ALL agents where this configuration built. After that full checkout will be performed when build of this configuration starts on such agents.- Specified by:
releaseSourcesin interfaceSBuildType
-
releaseSources
public void releaseSources(@NotNull SBuildAgent agent)Description copied from interface:SBuildTypeReleases sources of the build configuration on specified agent only. After that full checkout will be performed when build of this configuration starts on the specified agent.- Specified by:
releaseSourcesin interfaceSBuildType- Parameters:
agent- agent
-
getAgentsWhereBuildConfigurationBuilt
@NotNull public List<SBuildAgent> getAgentsWhereBuildConfigurationBuilt()
Description copied from interface:SBuildTypeReturns list of agents (sorted by name) where this build configuration was ever built.- Specified by:
getAgentsWhereBuildConfigurationBuiltin interfaceSBuildType- Returns:
- see above
-
getTags
public List<String> getTags()
Description copied from interface:SBuildTypeList of all tags set for builds of this configuration.- Specified by:
getTagsin interfaceSBuildType- Returns:
- union of tags for each build for the configuration.
-
forceCheckingForChanges
public void forceCheckingForChanges()
Description copied from interface:SBuildTypeStarts checking for changes for all VCS roots of this build configuration- Specified by:
forceCheckingForChangesin interfaceSBuildType
-
forceCheckingForChanges
public void forceCheckingForChanges(@NotNull OperationRequestor requestor)Description copied from interface:SBuildTypeStarts checking for changes for all VCS roots of this build configuration- Specified by:
forceCheckingForChangesin interfaceSBuildType
-
addToQueue
public SQueuedBuild addToQueue(@NotNull String triggeredBy)
Description copied from interface:SBuildTypeAdds build instance of the configuration to the queue with the specified requestor name.- Specified by:
addToQueuein interfaceSBuildType- Parameters:
triggeredBy- contains details about who triggered build, see alsoTriggeredByBuilder- Returns:
- new queued build instance if there is no instances of this configuration in the queue, or previously added instance otherwise.
-
addToQueue
public SQueuedBuild addToQueue(@NotNull BuildAgent agent, @NotNull String triggeredBy)
Description copied from interface:SBuildTypeAdds build instance of the configuration to the queue with the specified requestor name on the specified agent (if agent is authorized).- Specified by:
addToQueuein interfaceSBuildType- Parameters:
agent- specified agent.triggeredBy- contains details about who triggered build, see alsoTriggeredByBuilder- Returns:
nullif agent is not authorized, new SQueuedBuild instance if queue does not contain this configuration with specified agent and existing one otherwise
-
getQueuedBuilds
@NotNull public List<SQueuedBuild> getQueuedBuilds(@Nullable User user)
Description copied from interface:SBuildTypeIf user is null or has "Show personal builds of other users" enabled, returns all queued builds including all personal builds. Otherwise, returns non-personal queued builds and personal builds of the specified user.- Specified by:
getQueuedBuildsin interfaceSBuildType- Parameters:
user- user- Returns:
- see above
-
isCleanBuild
public boolean isCleanBuild()
Description copied from interface:SBuildTypeReturns if all files on an agent machine should be deleted before the build is started.- Specified by:
isCleanBuildin interfaceSBuildType- Returns:
- true, if agent has to clean all sources and download all sources from the server before each build of the configuration.
- See Also:
BuildTypeOptions.BT_CLEAN_BUILD
-
isShouldFailBuildIfTestsFailed
public boolean isShouldFailBuildIfTestsFailed()
Description copied from interface:SBuildTypeReturnstrueif build of the configuration has to fail if there is failed test.- Specified by:
isShouldFailBuildIfTestsFailedin interfaceSBuildType- Returns:
- true, if build has to became failed after at least one test failed, regardless of build script exit code.
- See Also:
BuildTypeOptions.BT_FAIL_IF_TESTS_FAIL
-
getExecutionTimeoutMin
public int getExecutionTimeoutMin()
Description copied from interface:SBuildTypeReturns duration the build allowed to run until killed by the server.- Specified by:
getExecutionTimeoutMinin interfaceSBuildType- Returns:
- build execution timeout in minutes, timeout 0 means 'forever'
- See Also:
BuildTypeOptions.BT_EXECUTION_TIMEOUT
-
getId
@NotNull public String getId()
Description copied from interface:BuildConfigurationInfoReturns build configuration internal id- Specified by:
getIdin interfaceBuildConfigurationInfo- Returns:
- see above
-
getMaximumNumberOfBuilds
public int getMaximumNumberOfBuilds()
Description copied from interface:SBuildTypeReturns maximum number of simultaneously running builds. 0 means there is no limit on a number of builds.- Specified by:
getMaximumNumberOfBuildsin interfaceBuildConfigurationInfo- Specified by:
getMaximumNumberOfBuildsin interfaceSBuildType- Returns:
- see above
- See Also:
BuildTypeOptions.BT_MAX_RUNNING_BUILDS
-
getMaximumNumberOfBuildsPerBranch
@NotNull public String getMaximumNumberOfBuildsPerBranch()
- Specified by:
getMaximumNumberOfBuildsPerBranchin interfaceBuildTypeEx- Returns:
- see
BuildTypeOptions.BT_MAX_RUNNING_BUILDS_PER_BRANCHwhich may include parameters references or null if no limits specified
-
getBuildDuration
public long getBuildDuration(@NotNull BuildAgent agent)Description copied from interface:BuildConfigurationInfoReturns estimated duration of a build on the specified agent.- Specified by:
getBuildDurationin interfaceBuildConfigurationInfo- Parameters:
agent- build agent.- Returns:
- Estimated time in milliseconds. -1 if an estimate cannot be calculated for some reason (e.g. lack of statistics).
-
isAllowExternalStatus
public boolean isAllowExternalStatus()
Description copied from interface:SBuildTypeReturns if viewing of the configuration status is allowed externally.- Specified by:
isAllowExternalStatusin interfaceSBuildType- Returns:
- if viewing of the configuration status is allowed externally.
- See Also:
BuildTypeOptions.BT_ALLOW_EXTERNAL_STATUS
-
getParametersProvider
@NotNull public ParametersProvider getParametersProvider()
Description copied from interface:ParametersSupportReturns parameters which can be used by value resolver. Note that some of the parameters may not have values defined because sometimes values can be calculated on the agent side only.- Specified by:
getParametersProviderin interfaceParametersSupport- Returns:
- parameters
-
getValueResolver
@NotNull public ValueResolver getValueResolver()
Description copied from interface:ParametersSupportReturns value resolver which can be used to resolve references in values- Specified by:
getValueResolverin interfaceParametersSupport- Returns:
- value resolver
-
moveToProject
public void moveToProject(@NotNull SProject target, boolean changeScopeOfLocalRoots)Description copied from interface:SBuildTypeMoves this build configuration to thetargetproject.- Specified by:
moveToProjectin interfaceSBuildType- Parameters:
target- the destination projectchangeScopeOfLocalRoots- not used since 8.0
-
moveToProject
public void moveToProject(@NotNull SProject target) throws InvalidVcsRootScopeExceptionDescription copied from interface:SBuildTypeMoves this build configuration to thetargetproject.- Specified by:
moveToProjectin interfaceSBuildType- Parameters:
target- the destination project- Throws:
InvalidVcsRootScopeException- if VCS roots used by this configuration will not be accessible in the target project
-
moveToProject
public void moveToProject(@NotNull ConfigAction cause, @NotNull SProject target) throws InvalidVcsRootScopeExceptionDescription copied from interface:SBuildTypeMoves this build configuration to thetargetproject.- Specified by:
moveToProjectin interfaceSBuildType- Parameters:
cause- config action caused the changetarget- the destination project- Throws:
InvalidVcsRootScopeException- if VCS roots used by this configuration will not be accessible in the target project
-
mapVcsPath
public PathMapping mapVcsPath(@NotNull String path)
Description copied from interface:SBuildTypeReturns path mapping for the given full VCS path of a file if this path can correspond to any of the project's VCS roots. (TODO serganch: describe the term "full VCS path" somewhere)- Specified by:
mapVcsPathin interfaceSBuildType- Specified by:
mapVcsPathin interfaceVcsWorkspaceAccess- Parameters:
path- a full path to a file (not necessarily existing)- Returns:
- the path mapping object or null if no mapping exists
-
getExtendedName
@NotNull public String getExtendedName()
Description copied from interface:SBuildTypeReturns the name of build configuration with additional note if the project is archived. Useful when archived build configurations should be shown together with non-archived.- Specified by:
getExtendedNamein interfaceSBuildType- Returns:
- build configuration name
- See Also:
SProject.getExtendedName()
-
getExtendedFullName
@NotNull public String getExtendedFullName()
Description copied from interface:SBuildTypeReturns the full name of build configuration with additional note if the project is archived. Useful when archived build configurations should be shown together with non-archived.- Specified by:
getExtendedFullNamein interfaceSBuildType- Returns:
- build configuration name
- See Also:
SProject.getExtendedFullName()
-
getFileContent
@NotNull public byte[] getFileContent(@NotNull String relativePath) throws VcsExceptionDescription copied from interface:SBuildTypeGet binary content of the latest version of a file related to this build type.- Specified by:
getFileContentin interfaceSBuildType- Specified by:
getFileContentin interfaceVcsWorkspaceAccess- Parameters:
relativePath- - relative file path regarding to the project root, "checkout root" from vcs root should not be included- Returns:
- - specified file content, corresponding to the build type
- Throws:
VcsException- if some problem occurred while getting file content from the source control repository.
-
getFileContent
@NotNull public byte[] getFileContent(@NotNull String relativePath, boolean latest) throws VcsExceptionDescription copied from interface:VcsWorkspaceAccessSame as {@link #getFileContent(String, false)}- Specified by:
getFileContentin interfaceVcsWorkspaceAccess- Parameters:
relativePath- relative file path regarding to the project root, "checkout root" from vcs root should not be includedlatest- if false, then file content corresponds to the revision detected during the last checking for changes process, if true, then the file content for the current repository revision will be returned- Returns:
- binary content of the file
- Throws:
VcsException- if some problem occurred while getting file content from the source control repository.
-
getVcsFilesBrowser
@NotNull public Browser getVcsFilesBrowser()
- Specified by:
getVcsFilesBrowserin interfaceVcsWorkspaceAccess- Returns:
- tree browser that shouws all contents VCS
-
getVcsFoldersBrowser
@NotNull public Browser getVcsFoldersBrowser()
- Specified by:
getVcsFoldersBrowserin interfaceVcsWorkspaceAccess- Returns:
- tree browser that shouws only directories in VCS
-
attachToTemplate
public void attachToTemplate(@NotNull BuildTypeTemplate template, boolean changeVcsRootsScope)Description copied from interface:SBuildTypeAttaches this build configuration to the specified template- Specified by:
attachToTemplatein interfaceSBuildType- Parameters:
template- templatechangeVcsRootsScope- if true then local non accessible VCS roots will be shared (not used since 8.0)
-
addTemplate
public void addTemplate(@NotNull BuildTypeTemplate template, boolean optimizeSettings) throws CannotAttachToTemplateExceptionDescription copied from interface:SBuildTypeAttach one more build configuration to a template. All previous templates will not be detached. If other templates are present in the build configuration, the newly attached templates will have the lowest priority, except for the default template (if configured in a corresponding project).- Specified by:
addTemplatein interfaceSBuildType- Parameters:
template- see aboveoptimizeSettings- If true, the build configuration's owner settings will be optimised by eliminating duplication- Throws:
CannotAttachToTemplateException
-
attachToTemplate
public void attachToTemplate(@NotNull BuildTypeTemplate template) throws CannotAttachToTemplateExceptionDescription copied from interface:SBuildTypeAttaches this build configuration to the specified template. If the configuration is already template based, it will be detached from that template without copying of settings from it prior to being attached to the new template.- Specified by:
attachToTemplatein interfaceSBuildType- Parameters:
template- template- Throws:
CannotAttachToTemplateException- if template is not accessible from this build configuration
-
setTemplatesOrder
public void setTemplatesOrder(@NotNull List<String> templatesOrder)Description copied from interface:SBuildTypeImposes new order on the templates the build configuration is attached to.- Specified by:
setTemplatesOrderin interfaceSBuildType- Parameters:
templatesOrder- the existing template ids in the new order. The list must match currently associated templates, excluding the default template.
-
setTemplates
public void setTemplates(@NotNull List<? extends BuildTypeTemplate> templates, boolean optimizeSettings)Description copied from interface:SBuildTypeReplaces templates the build configuration is attached to. No settings copying occurs for templates to which the configuration ceased to be attached to as a result.- Specified by:
setTemplatesin interfaceSBuildType- Parameters:
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.
-
getOwnTemplates
public List<? extends BuildTypeTemplate> getOwnTemplates()
Description copied from interface:SBuildTypeReturns a list of templates to which the build configuration is directly attached. That does not include default template.- Specified by:
getOwnTemplatesin interfaceSBuildType- Returns:
- see above
-
detachFromTemplate
public void detachFromTemplate()
Description copied from interface:SBuildTypeDetaches build configuration from all templates, except for the default one if present. Effective template settings are copied to the build configuration itself.- Specified by:
detachFromTemplatein interfaceSBuildType
-
removeTemplates
public void removeTemplates(@NotNull Collection<? extends BuildTypeTemplate> templates, boolean inlineSettings)Description copied from interface:SBuildTypeDetaches build configuration from a number of templates.- Specified by:
removeTemplatesin interfaceSBuildType- Parameters:
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
-
inline
@NotNull public BuildTypeEx inline()
Description copied from interface:BuildTypeExCreates a temporary copy of this buildType with all settings inherited from a project or a template inlined.- Specified by:
inlinein interfaceBuildTypeEx
-
persist
public void persist() throws PersistFailedExceptionDescription copied from interface:SPersistentEntityPersists this entity instance onto disk. Should be called each time when settings are changed, otherwise the changes will be lost after the server restart.- Specified by:
persistin interfaceBuildTypeSettings- Specified by:
persistin interfaceSBuildType- Specified by:
persistin interfaceSPersistentEntity- Throws:
PersistFailedException- if persisting failed
-
persist
public void persist(@NotNull ConfigAction cause) throws PersistFailedExceptionDescription copied from interface:SPersistentEntityPersists this entity on disk.- Specified by:
persistin interfaceBuildTypeSettings- Specified by:
persistin interfaceSPersistentEntity- Parameters:
cause- an action which caused persisting- Throws:
PersistFailedException- if persisting failed
-
schedulePersisting
@NotNull public PersistTask schedulePersisting(@NotNull ConfigAction cause) throws PersistFailedException
Description copied from interface:SPersistentEntitySchedules background persisting of this project settings.- Specified by:
schedulePersistingin interfaceSPersistentEntity- Parameters:
cause- an action which caused persisting- Returns:
- a task which can be used to track the operation progress or wait for the operation to complete
- Throws:
PersistFailedException- if failed to schedule the operation- See Also:
SPersistentEntity.schedulePersisting(String)
-
schedulePersisting
@NotNull public PersistTask schedulePersisting(@NotNull String reason) throws PersistFailedException
Description copied from interface:SPersistentEntitySchedules background persisting of this entity settings.- Specified by:
schedulePersistingin interfaceSPersistentEntity- Parameters:
reason- provides a reason why persist operation was called- Returns:
- a task which can be used to track the operation progress or wait for the operation to complete
- Throws:
PersistFailedException- if failed to schedule the operation- See Also:
SPersistentEntity.schedulePersisting(ConfigAction)
-
scheduleRemove
@NotNull public PersistTask scheduleRemove(@NotNull ConfigAction cause) throws PersistFailedException
Description copied from interface:SPersistentEntitySchedules remove of this persistent entity. Returns task which can be used to wait for the operation to complete.- Specified by:
scheduleRemovein interfaceSPersistentEntity- Parameters:
cause- reason of the remove- Returns:
- a task which can be used to track the operation progress or wait for the operation to complete
- Throws:
PersistFailedException- if failed to schedule the operation
-
getResolvedSettings
@NotNull public ResolvedSettings getResolvedSettings()
Description copied from interface:SBuildTypeReturns resolved settings of this build configuration (with parameter references substituted)- Specified by:
getResolvedSettingsin interfaceSBuildType- Returns:
- see above
-
getOwnDependencies
@NotNull public List<Dependency> getOwnDependencies()
Description copied from interface:SBuildTypeReturns list of own dependencies (not inherited from a template).- Specified by:
getOwnDependenciesin interfaceSBuildType- Returns:
- list of own dependencies
-
getCustomDataStorage
@NotNull public CustomDataStorage getCustomDataStorage(@NotNull String storageId)
Description copied from interface:SBuildTypeReturns custom data storage associated with this build configuration. Custom data storage allows to attach custom data to a build configuration. Example of custom data is a state of some plugin associated with this build type (not configuration of the plugin). Custom data will be automatically cleaned when build configuration is removed.- Specified by:
getCustomDataStoragein interfaceSBuildType- Parameters:
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.- Returns:
- custom data storage
-
getRunnerTypes
@NotNull public Collection<String> getRunnerTypes()
Description copied from interface:BuildTypeDescriptorReturns collection of types of enabled build runners configured in this configuration- Specified by:
getRunnerTypesin interfaceBuildTypeDescriptor- Specified by:
getRunnerTypesin interfaceBuildTypeSettings- Returns:
- see above
-
isPersonal
public boolean isPersonal()
Description copied from interface:BuildTypeDescriptorReturns if the configuration is temporary created for the personal build.- Specified by:
isPersonalin interfaceBuildTypeDescriptor- Returns:
- true if configuration was created to run some personal changes. Such sort of configurations are not available from an administrative interface, only for internal usage.
-
getRequirements
@NotNull public List<Requirement> getRequirements()
Description copied from interface:BuildTypeSettingsGet list of explicit requirements for build agents which can run this build configuration. Explicit requirements are specified by user in Web UI explicitly.- Specified by:
getRequirementsin interfaceBuildTypeSettings- Returns:
- see above
-
addRequirement
public void addRequirement(@NotNull Requirement requirement)Description copied from interface:BuildTypeSettingsAdds new build requirement to the configuration. If the requirement has no id, then a copy of it with new id is generated and added to the settings.- Specified by:
addRequirementin interfaceBuildTypeSettings- Parameters:
requirement- new requirement.
-
removeRequirement
public void removeRequirement(String propertyName)
Description copied from interface:BuildTypeSettingsRemoves first requirement with the specified property name from the configuration.- Specified by:
removeRequirementin interfaceBuildTypeSettings- Parameters:
propertyName- name of the requirement parameter.
-
removeRequirement
public void removeRequirement(Requirement requirement)
Description copied from interface:BuildTypeSettingsRemoves a requirement from the configuration.- Specified by:
removeRequirementin interfaceBuildTypeSettings- Parameters:
requirement- requirement to be removed
-
getBuildNumberPattern
@NotNull public String getBuildNumberPattern()
Description copied from interface:BuildTypeSettingsReturns current build number pattern- Specified by:
getBuildNumberPatternin interfaceBuildTypeSettings- Returns:
- see above
-
setBuildNumberPattern
public void setBuildNumberPattern(@NotNull String pattern)Description copied from interface:BuildTypeSettingsSets build number pattern. %build.counter% in the pattern will be replaced with current build number value when build starts- Specified by:
setBuildNumberPatternin interfaceBuildTypeSettings- Parameters:
pattern- pattern to set
-
getBuildParameters
@NotNull public Map<String,String> getBuildParameters()
Description copied from interface:BuildTypeReturns the map of build parameters specified by user. For more details please seeBuildTypeSettings.getBuildParameters()(server side).- Specified by:
getBuildParametersin interfaceBuildType- Specified by:
getBuildParametersin interfaceBuildTypeSettings- Returns:
- build parameters map
- See Also:
BuildType.getBuildParameter(String)
-
getParameters
@NotNull public Map<String,String> getParameters()
Description copied from interface:BuildTypeReturns map of build and configuration parameters.- Specified by:
getParametersin interfaceBuildType- Specified by:
getParametersin interfaceInheritableUserParametersHolder- Specified by:
getParametersin interfaceReadOnlyUserParameters- Returns:
- build and configuration parameters map
-
getParameterValue
@Nullable public String getParameterValue(@NotNull String paramName)
- Specified by:
getParameterValuein interfaceReadOnlyUserParameters- Parameters:
paramName- parameter name- Returns:
- value of the parameter with given name or null if there is no such parameter
-
getOwnParametersCollection
@NotNull public Collection<Parameter> getOwnParametersCollection()
- Specified by:
getOwnParametersCollectionin interfaceInheritableUserParametersHolder- Returns:
- own parameters, without inherited. Yet they would have inherited specs or values (if any).
-
getOwnParameters
@NotNull public Map<String,String> getOwnParameters()
- Specified by:
getOwnParametersin interfaceInheritableUserParametersHolder- Returns:
- own parameters map, without inherited. Yet they would have inherited specs or values (if any).
-
getBuildParametersCollection
@NotNull public Collection<Parameter> getBuildParametersCollection()
Description copied from interface:BuildTypeSettingsReturns build parameters collection.- Specified by:
getBuildParametersCollectionin interfaceBuildTypeSettings- Returns:
- see above
-
addBuildParameter
public void addBuildParameter(Parameter parameter)
Description copied from interface:BuildTypeSettingsAdds build parameter to the configuration. Build parameter is a system or environment variable. Concrete parameter type is being selected by its name prefix.Constants.SYSTEM_PREFIXfor system properties andConstants.ENV_PREFIXfor environment variable.- Specified by:
addBuildParameterin interfaceBuildTypeSettings- Parameters:
parameter- specified parameter.
-
removeBuildParameter
public void removeBuildParameter(String paramName)
Description copied from interface:BuildTypeSettingsRemoves existing build parameter by its name.- Specified by:
removeBuildParameterin interfaceBuildTypeSettings- Parameters:
paramName- specified parameter name.
-
addRunParameter
public void addRunParameter(@NotNull Parameter parameter)Description copied from interface:BuildTypeExFor tests only!- Specified by:
addRunParameterin interfaceBuildTypeEx
-
getLogicalBranchNames
@NotNull public Set<String> getLogicalBranchNames(@NotNull VcsRootInstance root, @NotNull String vcsBranch)
Description copied from interface:BuildTypeExReturns set of possible logical names for the given VCS branch in the given VCS root according to current VCS root settings (i.e. default branch, branch spec)- Specified by:
getLogicalBranchNamesin interfaceBuildTypeEx- Parameters:
root- root of interestvcsBranch- vcs branch of interest- Returns:
- see above or null if branch spec is not specified for this vcs root instance
-
getDefaultBranchDisplayName
@NotNull public String getDefaultBranchDisplayName()
Description copied from interface:BuildTypeExReturns a display name of the default branch according to the current settings of all VCS roots attached to build configuration (their default branch vcs names and branch specs). Returned value might be different from Branch.DEFAULT_BRANCH_NAME when logical name of the default branch in all the roots is the same.- Specified by:
getDefaultBranchDisplayNamein interfaceBuildTypeEx- Returns:
- see above
-
getBranchByDisplayName
@NotNull public BranchEx getBranchByDisplayName(@NotNull String branchDisplayName)
Description copied from interface:BuildTypeExReturns a branch by its display name.Usually branch display equals to branch name. The only exception is default branch (see comments to
BuildTypeEx.getDefaultBranchDisplayName(). This method allows you to get a default branch by its custom display name. UseBuildTypeEx.getBranch(String)method if you are sure you use a branch name (not a display name) or branch is not a default one, because this method is slower thanBuildTypeEx.getBranch(String).- Specified by:
getBranchByDisplayNamein interfaceBuildTypeEx- Parameters:
branchDisplayName- branch display name- Returns:
- see above
-
hasBuilds
public boolean hasBuilds()
- Specified by:
hasBuildsin interfaceBuildTypeEx- Returns:
- true if this build configuration has builds
-
isInQueue
public boolean isInQueue()
Description copied from interface:BuildTypeReturns true if the configuration is queued at the moment
-
getNumberQueued
public int getNumberQueued()
Description copied from interface:BuildTypeReturns number of items for this build configurations currently waiting in queue- Specified by:
getNumberQueuedin interfaceBuildType- Returns:
- number of queued builds of this configuration.
-
getStatus
public Status getStatus()
Description copied from interface:BuildTypeReturns current status of the configuration.
-
getStatusDescriptor
@NotNull public BuildTypeStatusDescriptor getStatusDescriptor()
Description copied from interface:BuildTypeReturns current status of the configuration with text description and status build.- Specified by:
getStatusDescriptorin interfaceBuildType- Returns:
- configuration status, which is calculated according to statuses of all the running builds (except personal) plus latest finished one.
-
getResponsibilityInfo
@NotNull public ResponsibilityEntry getResponsibilityInfo()
Description copied from interface:BuildTypeReturns the information about responsibility on this build configuration.- Specified by:
getResponsibilityInfoin interfaceBuildType- Returns:
- ResponsibilityEntry information for this build configuration
- See Also:
ResponsibilityEntry,BuildType.setResponsible(User, String, User),BuildType.removeResponsible(boolean, User, String, User)
-
setResponsible
public void setResponsible(@NotNull User responsibleUser, String userComment, User reporterUser)Description copied from interface:BuildTypeCalled when a user takes a responsibility for the build type.Clients are encouraged to use
BuildTypeResponsibilityFacadeservice when possible, as it provides more flexibility.- Specified by:
setResponsiblein interfaceBuildType- Parameters:
responsibleUser- responsible user. Not nulluserComment- user message. Will be shown in UIreporterUser- user who performs the action. May be null for automated operations
-
removeResponsible
public void removeResponsible(boolean buildWasFixed, @Nullable User responsibleUser, String comment, User whoPerformsTheAction)Description copied from interface:BuildTypeRemoves responsible information , mark it is either 'fixed' or 'not fixed'.Clients are encouraged to use
BuildTypeResponsibilityFacadeservice when possible, as it provides more flexibility.- Specified by:
removeResponsiblein interfaceBuildType- Parameters:
buildWasFixed- if true, build configuration will be marked as fixedresponsibleUser- User who performs the action. May be null for automated operationscomment- user message. Will be shown in UIwhoPerformsTheAction- user who performs the action. May be null for automated operations
-
getBuildByBuildNumber
public Build getBuildByBuildNumber(@NotNull String buildNumber)
Description copied from interface:BuildTypeReturns most recent build instance with specified build number. Generally, build number is unique but duplicates may happen if manually reset at build configuration page.- Specified by:
getBuildByBuildNumberin interfaceBuildType- Parameters:
buildNumber- specified build number.- Returns:
- most recent build instance with the given number.
-
getBuildParameter
public String getBuildParameter(String key)
Description copied from interface:BuildTypeReturns build parameter by parameter key- Specified by:
getBuildParameterin interfaceBuildType- Specified by:
getBuildParameterin interfaceBuildTypeSettings- Parameters:
key- parameter key- Returns:
- build parameter by parameter key
-
getVcsRoots
@NotNull public List<SVcsRoot> getVcsRoots()
Description copied from interface:BuildTypeReturns all roots currently attached to this configuration- Specified by:
getVcsRootsin interfaceBuildType- Specified by:
getVcsRootsin interfaceBuildTypeSettings- Returns:
- collection of all attached vcs roots.
-
addBuildTrigger
public boolean addBuildTrigger(@NotNull BuildTriggerDescriptor triggerDescriptor)Description copied from interface:BuildTypeSettingsAdds new trigger to build configuration settings. UseBuildTriggerDescriptorFactoryto create trigger descriptor.- Specified by:
addBuildTriggerin interfaceBuildTypeSettings- Parameters:
triggerDescriptor- trigger descriptor- Returns:
- true if trigger was added, and false if trigger with such id already exists
-
addBuildTrigger
@NotNull public BuildTriggerDescriptor addBuildTrigger(@NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:BuildTypeSettingsAdds new trigger of specified type and with specified parameters to build configuration settings.- Specified by:
addBuildTriggerin interfaceBuildTypeSettings- Parameters:
type- type of the triggerparams- parameters map- Returns:
- newly created trigger descriptor
-
removeBuildTrigger
public boolean removeBuildTrigger(@NotNull BuildTriggerDescriptor triggerDescriptor)Description copied from interface:BuildTypeSettingsRemoves specified build trigger from the settings- Specified by:
removeBuildTriggerin interfaceBuildTypeSettings- Parameters:
triggerDescriptor- trigger descriptor- Returns:
- true if trigger was actually removed and false otherwise
-
updateBuildTrigger
public boolean updateBuildTrigger(@NotNull String triggerId, @NotNull String newType, @NotNull Map<String,String> newParams)Description copied from interface:BuildTypeSettingsUpdates build trigger descriptor with specified id, changes type and parameters.- Specified by:
updateBuildTriggerin interfaceBuildTypeSettings- Parameters:
triggerId- id of build trigger descriptornewType- type of build trigger descriptornewParams- parameters map- Returns:
- true if parameters of build trigger descriptor were changed (descriptor with such id exists) and false otherwise
-
updateBuildTrigger
public boolean updateBuildTrigger(@NotNull BuildTriggerDescriptor newDescriptor)Description copied from interface:BuildTypeSettingsUpdates build trigger descriptor with id equal to newDescriptor id.- Specified by:
updateBuildTriggerin interfaceBuildTypeSettings- Parameters:
newDescriptor- new settings of the trigger- Returns:
- true if parameters of build trigger descriptor were changed (descriptor with such id exists) and false otherwise
-
getBuildTriggersCollection
@NotNull public Collection<BuildTriggerDescriptor> getBuildTriggersCollection()
Description copied from interface:BuildTypeSettingsReturns collection of build trigger settings- Specified by:
getBuildTriggersCollectionin interfaceBuildTypeSettings- Specified by:
getBuildTriggersCollectionin interfaceResolvedSettings- Returns:
- see above
-
findTriggerById
public BuildTriggerDescriptor findTriggerById(@NotNull String triggerId)
Description copied from interface:BuildTypeSettingsFinds build trigger descriptor by its' id- Specified by:
findTriggerByIdin interfaceBuildTypeSettings- Parameters:
triggerId- id of the trigger- Returns:
- build trigger descriptor or null if trigger with such id not found
-
setCheckoutType
public void setCheckoutType(BuildTypeDescriptor.CheckoutType type)
Description copied from interface:BuildTypeSettingsSets preferred checkout type for the configuration sources. Actual checkout type may differ, for example, if preferred checkout type is set to ON_AGENT, but there is vcs root which does not support on agent checkout, actual checkout type will be switched to ON_SERVER.BuildTypeDescriptor.CheckoutType.ON_SERVER- checkout sources automatically on the server and snd it to the agent.BuildTypeDescriptor.CheckoutType.ON_AGENT- checkout sources automatically on the agent.BuildTypeDescriptor.CheckoutType.MANUAL- do not check out sources automatically.- Specified by:
setCheckoutTypein interfaceBuildTypeSettings- Parameters:
type- new checkout type.
-
getCheckoutType
@NotNull public BuildTypeDescriptor.CheckoutType getCheckoutType()
Description copied from interface:BuildTypeDescriptorReturns method used by agent to retrieve project sources. CheckoutType.ON_SERVER server creates patch and sends it to agent CheckoutType.ON_AGENT agent checks sources out CheckoutType.MANUAL script does it itself.- Specified by:
getCheckoutTypein interfaceBuildTypeDescriptor- Specified by:
getCheckoutTypein interfaceBuildTypeSettings- Returns:
- method to get sources on agent.
-
isPaused
public boolean isPaused()
Description copied from interface:BuildTypeDescriptorReturns if the configuration is paused.- Specified by:
isPausedin interfaceBuildTypeDescriptor- Returns:
- true is build is paused. In this state build can be added to queue manually only, all other triggers are disabled.
-
getProjectId
@NotNull public String getProjectId()
Description copied from interface:BuildTypeDescriptorReturns internal id of the project this build configuration configured in.- Specified by:
getProjectIdin interfaceBuildTypeDescriptor- Returns:
- parent project internal id.
-
getProjectExternalId
@NotNull public String getProjectExternalId()
Description copied from interface:BuildTypeDescriptorReturns external id of the project this build configuration configured in.- Specified by:
getProjectExternalIdin interfaceBuildTypeDescriptor- Returns:
- parent project external id.
-
setCheckoutDirectory
public void setCheckoutDirectory(@Nullable String dir)Description copied from interface:BuildTypeSettingsSets build checkout directory. Set it to null to use default checkout directory.- Specified by:
setCheckoutDirectoryin interfaceBuildTypeSettings- Parameters:
dir- checkout directory
-
getCheckoutDirectory
@Nullable public String getCheckoutDirectory()
Description copied from interface:BuildTypeSettingsReturns build checkout directory - if specified explicitly using
BuildTypeSettings.setCheckoutDirectory(String). Returnsnullif default checkout directory, generated by TeamCity should be used.- Specified by:
getCheckoutDirectoryin interfaceBuildTypeSettings- Specified by:
getCheckoutDirectoryin interfaceResolvedSettings- Returns:
- build checkout directory.
- See Also:
BuildTypeSettings.setCheckoutDirectory(String)
-
setArtifactPaths
public void setArtifactPaths(@Nullable String artifactPaths)Description copied from interface:BuildTypeSettingsSets build artifact paths. Artifact paths are comma separated paths to build artifacts. Support ant-style wildcards and target directories like *.zip => winFiles,unix/dist.tgz => linuxFiles, where winFiles and linuxFiles are target directories. Set to null or empty string to disable artifacts processing.- Specified by:
setArtifactPathsin interfaceBuildTypeSettings- Parameters:
artifactPaths- paths to build artifacts
-
getArtifactPaths
@Nullable public String getArtifactPaths()
Description copied from interface:BuildTypeSettingsReturns build artifact paths.- Specified by:
getArtifactPathsin interfaceBuildTypeSettings- Returns:
- build artifact paths
-
getArtifactDependencies
@NotNull public List<SArtifactDependency> getArtifactDependencies()
Description copied from interface:BuildTypeSettingsReturns artifacts this build configuration depending on.- Specified by:
getArtifactDependenciesin interfaceBuildTypeSettings- Returns:
- list of artifacts this build configuration depending on
-
setArtifactDependencies
public void setArtifactDependencies(@NotNull List<SArtifactDependency> artifacts)Description copied from interface:BuildTypeSettingsSets artifacts this build configuration depending on.- Specified by:
setArtifactDependenciesin interfaceBuildTypeSettings- Parameters:
artifacts- new artifacts dependency list.
-
addArtifactDependency
public void addArtifactDependency(@NotNull SArtifactDependency dependency)Description copied from interface:BuildTypeSettingsAdds artifact dependency.- Specified by:
addArtifactDependencyin interfaceBuildTypeSettings- Parameters:
dependency- new artifact dependency
-
removeArtifactDependency
public void removeArtifactDependency(@NotNull SArtifactDependency dependency)Description copied from interface:BuildTypeSettingsRemoves artifact dependency.- Specified by:
removeArtifactDependencyin interfaceBuildTypeSettings- Parameters:
dependency- artifact dependency
-
containsVcsRoot
public boolean containsVcsRoot(long vcsRootId)
Description copied from interface:BuildTypeSettingsReturns true if VCS root with specified id is attached directly or is inherited via a template- Specified by:
containsVcsRootin interfaceBuildTypeSettings- Parameters:
vcsRootId- id of VCS root- Returns:
- see above
-
getVcsRootEntries
@NotNull public List<VcsRootEntry> getVcsRootEntries()
Description copied from interface:BuildTypeSettingsReturns all entries of vcs roots. Each entry contains reference to root and its checkout rules.- Specified by:
getVcsRootEntriesin interfaceBuildTypeSettings- Returns:
- all entries of vcs roots for this configuration
-
addVcsRoot
public boolean addVcsRoot(@NotNull SVcsRoot root) throws InvalidVcsRootScopeException, VcsRootNotFoundExceptionDescription copied from interface:BuildTypeSettingsAdds VCS root to the build configuration with default checkout rules.- Specified by:
addVcsRootin interfaceBuildTypeSettings- Parameters:
root- VCS root to add- Returns:
- true if VCS root was actually added and false otherwise (this VCS root already exists)
- Throws:
InvalidVcsRootScopeException- if VCS root scope is local and corresponds to another project (not the project - owner of this build configuration)VcsRootNotFoundException- if specified VCS root does not exist anymore
-
removeVcsRoot
public boolean removeVcsRoot(@NotNull SVcsRoot root)Description copied from interface:BuildTypeSettingsRemoves existing VCS root from the build configuration. If there were checkout rules attached to this VCS root they will be removed too.- Specified by:
removeVcsRootin interfaceBuildTypeSettings- Parameters:
root- VCS root to remove- Returns:
- true if VCS root was actually removed from the build configuration and false if build configuration did not have this vcs root attached
-
replaceVcsRoot
public boolean replaceVcsRoot(@NotNull SVcsRoot oldVcsRoot, @NotNull SVcsRoot newVcsRoot)Description copied from interface:BuildTypeExReplaces existing VCS root entry in settings with a new one, maintaining the order of the root entries- Specified by:
replaceVcsRootin interfaceBuildTypeEx- Parameters:
oldVcsRoot- VCS root to be replacednewVcsRoot- VCS root to insert instead- Returns:
- true if VCS root was actually replaced, false otherwise (the root to be replaced did not exist or the new root already existed)
-
setVcsRoots
public boolean setVcsRoots(@NotNull Collection<SVcsRoot> vcsRoots)Description copied from interface:BuildTypeExSets VCS roots. All existing VCS roots that are not present in vcsRoots are deleted, all other existing VCS roots are reordered if necessary, but retain their original checkout rules.- Specified by:
setVcsRootsin interfaceBuildTypeEx- Returns:
- true if any changes occurred
-
setEditable
public void setEditable(boolean editable)
Description copied from interface:BuildTypeExEnables or disables editing of the build type in web UI, see alsoSPersistentEntity.isReadOnly().SBuildType.persist()method must be called afterwards.- Specified by:
setEditablein interfaceBuildTypeEx- Parameters:
editable- true to enable editing and false to disable
-
setCheckoutRules
public boolean setCheckoutRules(@NotNull VcsRoot root, @NotNull CheckoutRules checkoutRules)Description copied from interface:BuildTypeSettingsSets checkout rules for specified VCS root. VCS root must be attached to this build configuration.- Specified by:
setCheckoutRulesin interfaceBuildTypeSettings- Parameters:
root- root to set rules forcheckoutRules- checkout rules for the VCS root- Returns:
- true if checkout rules were set for the VCS root (if VCS root is attached) and false otherwise
-
getCheckoutRules
public CheckoutRules getCheckoutRules(@NotNull VcsRoot root)
Description copied from interface:BuildTypeSettingsReturns checkout rules configured for the specified VCS root. If specified VCS root is not attached to this build configuration, then null is returned.- Specified by:
getCheckoutRulesin interfaceBuildTypeSettings- Specified by:
getCheckoutRulesin interfaceResolvedSettings- Parameters:
root- VCS root- Returns:
- checkout rules or null if specified VCS root is not attached to the build configuration
-
getLabelingType
@NotNull public VcsLabelingSettings.LabelingType getLabelingType()
- Specified by:
getLabelingTypein interfaceVcsLabelingSettings- Returns:
- Returns labeling mode
-
getLabelPattern
@NotNull public String getLabelPattern()
- Specified by:
getLabelPatternin interfaceVcsLabelingSettings- Returns:
- Returns pattern to use for labeling
-
getLabelingRoots
@NotNull public List<VcsRoot> getLabelingRoots()
Description copied from interface:VcsLabelingSettingsList of roots which should be processed by labeling process- Specified by:
getLabelingRootsin interfaceVcsLabelingSettings- Returns:
- list of up-to-date vcs roots
-
addConfigParameter
public void addConfigParameter(@NotNull Parameter param)Description copied from interface:BuildTypeSettingsAdds configuration parameter. There are three different types of parameters which can be added to build configuration settings:- build parameters - these are parameters passed to agent and then to a build (see
BuildTypeSettings.addBuildParameter(Parameter)), these parameters must have prefix system. or env. - runner parameters - these are parameters of a runner, they are transferred to agent and passed to corresponding build runner plugin
- configuration parameters - these parameters are not transferred to agent or build, but can be referenced in various places (including build & runner parameters and thus can effectively pass to a build)
- Specified by:
addConfigParameterin interfaceBuildTypeSettings- Parameters:
param- configuration parameter
- build parameters - these are parameters passed to agent and then to a build (see
-
removeConfigParameter
public void removeConfigParameter(@NotNull String paramName)Description copied from interface:BuildTypeSettingsRemoves configuration parameters with specified name- Specified by:
removeConfigParameterin interfaceBuildTypeSettings- Parameters:
paramName- parameter name
-
addParameter
public void addParameter(@NotNull Parameter param)Description copied from interface:UserParametersHolderAdds parameter.- Specified by:
addParameterin interfaceUserParametersHolder- Parameters:
param- build or config parameter, the type is determined by parameter prefix
-
removeParameter
public void removeParameter(@NotNull String paramName)Description copied from interface:UserParametersHolderRemoves parameter.- Specified by:
removeParameterin interfaceUserParametersHolder- Parameters:
paramName- build or config parameter name, the type is determined by parameter prefix
-
getParametersCollection
@NotNull public Collection<Parameter> getParametersCollection()
Description copied from interface:ReadOnlyUserParametersReturns build and configuration parameters in single collection.- Specified by:
getParametersCollectionin interfaceInheritableUserParametersHolder- Specified by:
getParametersCollectionin interfaceReadOnlyUserParameters- Returns:
- merged collection of parameters, i.e. all parameters inherited from parent holders and own parameters
-
getParameter
@Nullable public Parameter getParameter(@NotNull String paramName)
- Specified by:
getParameterin interfaceReadOnlyUserParameters
-
getConfigParametersCollection
@NotNull public Collection<Parameter> getConfigParametersCollection()
Description copied from interface:BuildTypeSettingsReturns collection of configuration parameters.- Specified by:
getConfigParametersCollectionin interfaceBuildTypeSettings- Returns:
- see above
-
getConfigParameters
@NotNull public Map<String,String> getConfigParameters()
Description copied from interface:BuildTypeSettingsReturns map of configuration parameters- Specified by:
getConfigParametersin interfaceBuildTypeSettings- Returns:
- see above
-
getUndefinedParameters
@NotNull public List<String> getUndefinedParameters()
Description copied from interface:BuildTypeSettingsReturns collection of parameter names (config and build params) referenced in the build configuration settings but without values provided. I.e. there is a reference to a parameter but such parameter is not defined anywhere.
Parameter value can come from different sources:- build configuration or template settings
- agents
- various extensions
- Specified by:
getUndefinedParametersin interfaceBuildTypeSettings- Returns:
- see above
-
getRunTypeRequirements
@NotNull public List<Requirement> getRunTypeRequirements()
Description copied from interface:BuildTypeSettingsReturns list of additional agent requirements imposed by configured runners.- Specified by:
getRunTypeRequirementsin interfaceBuildTypeSettings- Returns:
- see above
-
getBuildFeatureRequirements
@NotNull public List<Requirement> getBuildFeatureRequirements()
Description copied from interface:BuildTypeSettingsReturns list of additional agent requirements imposed by configured enabled build features.- Specified by:
getBuildFeatureRequirementsin interfaceBuildTypeSettings- Returns:
- see above
-
addBuildRunner
@NotNull public SBuildRunnerDescriptor addBuildRunner(@NotNull BuildRunnerDescriptor runner)
Description copied from interface:BuildTypeSettingsAdds runner descriptor. UseBuildRunnerDescriptorFactoryto create instance of runner descriptor.
Before 8.0 this method requiredSBuildRunnerDescriptoras parameter- Specified by:
addBuildRunnerin interfaceBuildTypeSettings- Parameters:
runner- descriptor- Returns:
- instance of actually added runner
-
addBuildRunner
@NotNull public SBuildRunnerDescriptor addBuildRunner(@NotNull String name, @NotNull String runnerType, @NotNull Map<String,String> parameters)
Description copied from interface:BuildTypeSettingsCreates new build runner and adds it to these settings. Runner's ID is autogenerated- Specified by:
addBuildRunnerin interfaceBuildTypeSettings- Parameters:
name- runner namerunnerType- type of the runnerparameters- runner parameters- Returns:
- newly created runner
-
addBuildRunner
@NotNull public SBuildRunnerDescriptor addBuildRunner(@NotNull String id, @NotNull String name, @NotNull String runnerType, @NotNull Map<String,String> parameters) throws DuplicateIdException, InvalidIdentifierException, ReadOnlyEntityException
Description copied from interface:BuildTypeSettingsCreates a new build runner with the specified id, name, runner type, and parameters, and adds it to the current build settings.- Specified by:
addBuildRunnerin interfaceBuildTypeSettings- Parameters:
id- the unique id of the build runner (should be unique within all runners of this configuration)name- the name of the build runnerrunnerType- the type of the build runnerparameters- the parameters for the build runner- Returns:
- the newly created build runner descriptor
- Throws:
DuplicateIdException- if the id is already in use by another build runner, runners inherited from templates are not consideredInvalidIdentifierException- if the id is invalid or emptyReadOnlyEntityException- if the settings are read-only and cannot be modified
-
removeBuildRunner
public SBuildRunnerDescriptor removeBuildRunner(@NotNull String runnerId)
Description copied from interface:BuildTypeSettingsRemoves runner descriptor with specified id.- Specified by:
removeBuildRunnerin interfaceBuildTypeSettings- Parameters:
runnerId- descriptor id- Returns:
- removed runner descriptor
-
updateBuildRunner
public boolean updateBuildRunner(@NotNull String runnerId, @NotNull String name, @NotNull String type, @NotNull Map<String,String> params)Description copied from interface:BuildTypeSettingsUpdates parameters in the existing build runner descriptor. Does nothing if there runner with specified id was not found.- Specified by:
updateBuildRunnerin interfaceBuildTypeSettings- Parameters:
runnerId- id of runner descriptorname- new runner nametype- new type of the runnerparams- new runner parameters- Returns:
- true if parameters updated and false otherwise
-
getBuildRunners
@NotNull public List<SBuildRunnerDescriptor> getBuildRunners()
Description copied from interface:BuildTypeSettingsReturns collection of build runners attached to these settings- Specified by:
getBuildRunnersin interfaceBuildTypeSettings- Specified by:
getBuildRunnersin interfaceResolvedSettings- Returns:
- see above
-
findBuildRunnerByType
@Nullable public SBuildRunnerDescriptor findBuildRunnerByType(@NotNull String runnerType)
Description copied from interface:SBuildTypeReturns first build runner of specified type or null- Specified by:
findBuildRunnerByTypein interfaceBuildType- Specified by:
findBuildRunnerByTypein interfaceBuildTypeSettings- Specified by:
findBuildRunnerByTypein interfaceSBuildType- Parameters:
runnerType- type of the runner- Returns:
- see above
-
findBuildRunnerById
public SBuildRunnerDescriptor findBuildRunnerById(@NotNull String runnerId)
Description copied from interface:BuildTypeSettingsFinds build runner by its' id- Specified by:
findBuildRunnerByIdin interfaceBuildTypeSettings- Parameters:
runnerId- id of the runner- Returns:
- build runner or null if runner with such id not found
-
findRunnerParameter
public String findRunnerParameter(@NotNull String paramName)
Description copied from interface:BuildTypeSettingsSearches runner parameter in all build runners and returns value of the first found parameter with given name.- Specified by:
findRunnerParameterin interfaceBuildTypeSettings- Parameters:
paramName- name of the parameter- Returns:
- the first found parameter value or null
-
getRunnerConditions
@NotNull public BuildStepConditions getRunnerConditions(@NotNull SBuildRunnerDescriptor descriptor)
- Specified by:
getRunnerConditionsin interfaceBuildTypeSettings- Returns:
- support for conditions for conditional build steps
-
isTemplateBased
public boolean isTemplateBased()
Description copied from interface:BuildTypeSettingsReturns true if these settings are directly based on a template. It does not take into account a default template.- Specified by:
isTemplateBasedin interfaceBuildTypeSettings- Returns:
- see above
-
setOption
public <T> void setOption(@NotNull Option<T> option, @NotNull T value)Description copied from interface:OptionSupportSet option value, clears value if it is the same as default- Specified by:
setOptionin interfaceOptionSupport- Parameters:
option- option to set value forvalue- option value
-
getOwnOptions
@NotNull public Collection<Option> getOwnOptions()
Description copied from interface:OptionSupportReturn options defined in this object, i.e. options for which some value has been set usingOptionSupport.setOption(Option, Object)method.- Specified by:
getOwnOptionsin interfaceOptionSupport- Returns:
- see above
-
getOptions
@NotNull public Collection<Option> getOptions()
- Specified by:
getOptionsin interfaceOptionSupport- Returns:
- combined set of options - own and inherited
-
getChangedOptions
@NotNull public Option[] getChangedOptions()
Description copied from interface:OptionSupportReturn options with changed values, i.e. options with non-default values- Specified by:
getChangedOptionsin interfaceOptionSupport- Returns:
- see above
-
getOption
@NotNull public <T> T getOption(@NotNull Option<T> option)Description copied from interface:OptionSupportGet option value- Specified by:
getOptionin interfaceOptionSupport- Parameters:
option- option to retrieve value for- Returns:
- value of the option. If value wasn't set, Option:getDefaultValue is returned
-
getOptionDefaultValue
@NotNull public <T> T getOptionDefaultValue(@NotNull Option<T> option)- Specified by:
getOptionDefaultValuein interfaceOptionSupport- Parameters:
option- option whose default value to return- Returns:
- default value for specified option
-
getDependencies
@NotNull public List<Dependency> getDependencies()
Description copied from interface:DependencySettingsGet existing dependencies, empty collection when no dependencies exist- Specified by:
getDependenciesin interfaceDependencySettings- Returns:
- see above
-
addDependency
public void addDependency(@NotNull Dependency dependOn) throws CyclicDependencyFoundExceptionDescription copied from interface:DependencySettingsAdd dependency on another build configuration- Specified by:
addDependencyin interfaceDependencySettings- Parameters:
dependOn- new dependency- Throws:
CyclicDependencyFoundException- if cycle is detected
-
removeDependency
public boolean removeDependency(@NotNull Dependency dependOn)Description copied from interface:DependencySettingsRemove dependency on another build configuration- Specified by:
removeDependencyin interfaceDependencySettings- Parameters:
dependOn- dependency to remove- Returns:
- true if dependency was actually removed
-
getCleanupPolicies
@NotNull public Collection<HistoryRetentionPolicy> getCleanupPolicies()
- Specified by:
getCleanupPoliciesin interfaceCleanupSettings- Returns:
- combined cleanup policies, including those inherited from default or parent object
-
getOwnCleanupPolicies
@NotNull public Collection<HistoryRetentionPolicy> getOwnCleanupPolicies()
- Specified by:
getOwnCleanupPoliciesin interfaceCleanupSettings- Returns:
- cleanup policies, specific for this object only
-
getInheritedCleanupPolicies
@NotNull public Collection<HistoryRetentionPolicy> getInheritedCleanupPolicies()
- Specified by:
getInheritedCleanupPoliciesin interfaceCleanupSettings
-
getInheritedCleanupOptions
@NotNull public Map<String,Boolean> getInheritedCleanupOptions()
- Specified by:
getInheritedCleanupOptionsin interfaceCleanupSettings
-
getCleanupOptions
@NotNull public Map<String,Boolean> getCleanupOptions()
- Specified by:
getCleanupOptionsin interfaceCleanupSettings- Returns:
- map of all cleanup options
-
getOwnCleanupOptions
@NotNull public Map<String,Boolean> getOwnCleanupOptions()
- Specified by:
getOwnCleanupOptionsin interfaceCleanupSettings- Returns:
- map of own cleanup options only
-
addCleanupPolicy
public void addCleanupPolicy(@NotNull HistoryRetentionPolicy policy)Description copied from interface:CleanupSettingsInitSets cleanup policy for this build configuration- Specified by:
addCleanupPolicyin interfaceCleanupSettingsInit- Parameters:
policy- policy to set
-
removeCleanupPolicies
public void removeCleanupPolicies()
Description copied from interface:CleanupSettingsInitRemove all own cleanup policies for the object- Specified by:
removeCleanupPoliciesin interfaceCleanupSettingsInit
-
setCleanupOption
public void setCleanupOption(@NotNull String option, @Nullable Boolean value)Description copied from interface:CleanupSettingsInitSets value for a cleanup option- Specified by:
setCleanupOptionin interfaceCleanupSettingsInit- Parameters:
option- cleanup option (seeCleanupSettingsconstants)value- value to set option to, ornullto remove the option
-
getTemplate
public BuildTypeTemplate getTemplate()
Description copied from interface:BuildTypeSettingsReturns the first template these settings are based on.- Specified by:
getTemplatein interfaceBuildTypeSettings- Returns:
- see above
-
getTemplates
@NotNull public List<? extends BuildTypeTemplate> getTemplates()
Description copied from interface:BuildTypeSettingsReturns templates these settings are based on, including the default template.- Specified by:
getTemplatesin interfaceBuildTypeSettings- Returns:
- see above
-
getTemplateIds
@NotNull public List<String> getTemplateIds()
Description copied from interface:BuildTypeSettingsReturns internal ids of the templates this settings are based on, including one of the default template- Specified by:
getTemplateIdsin interfaceBuildTypeSettings- Returns:
- see above
-
getTemplateId
public String getTemplateId()
Description copied from interface:BuildTypeSettingsReturns internal id of the first template this setting is based on- Specified by:
getTemplateIdin interfaceBuildTypeSettings- Returns:
- see above
-
getDependencyReferences
@NotNull public List<SBuildType> getDependencyReferences()
Description copied from interface:SBuildTypeReturns list of build configurations directly referencing this build configuration. The returned list is filtered by current user permissions and may contain not all references.- Specified by:
getDependencyReferencesin interfaceSBuildType- Returns:
- see above
-
getChildDependencies
@NotNull public Collection<SBuildType> getChildDependencies()
Description copied from interface:DependentReturns all child dependencies collected down the chain. Note that returned dependencies are sorted by depth in the chain. Note that returned collection will contain accessible by current authority holder objects only.- Specified by:
getChildDependenciesin interfaceDependent- Returns:
- see above
-
getNumberOfDependencyReferences
public int getNumberOfDependencyReferences()
Description copied from interface:SBuildTypeReturns number of dependency references (the number includes all references even those which are not available because of permissions)- Specified by:
getNumberOfDependencyReferencesin interfaceSBuildType- Returns:
- see above
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceBuildTypeSettings- Specified by:
isReadOnlyin interfaceSPersistentEntity- Returns:
- true if this entity settings are in read only mode
-
getReadOnlyReason
@Nullable public ReadOnlyReason getReadOnlyReason()
- Specified by:
getReadOnlyReasonin interfaceBuildTypeSettings- Specified by:
getReadOnlyReasonin interfaceSPersistentEntity- Returns:
- reason why this entity settings are in read only state or null if they are not read only
-
replaceInValues
public boolean replaceInValues(@NotNull String regexp, @NotNull String replacement) throws PatternSyntaxExceptionDescription copied from interface:BuildTypeSettingsReplaces values according to specified regexp and replacement string in all text parameters of the build configuration- Specified by:
replaceInValuesin interfaceBuildTypeSettings- Parameters:
regexp- regexpreplacement- replacement- Returns:
- true if at least one text value was affected and false otherwise
- Throws:
PatternSyntaxException- if pattern is incorrect
-
addBuildFeature
@NotNull public SBuildFeatureDescriptor addBuildFeature(@NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:BuildTypeSettingsAdds build feature with specified type and parameters to this settings object.- Specified by:
addBuildFeaturein interfaceBuildTypeSettings- Parameters:
type- build feature typeparams- build feature parameters- Returns:
- build feature descriptor
-
addBuildFeature
public void addBuildFeature(@NotNull SBuildFeatureDescriptor feature)Description copied from interface:BuildTypeSettingsAdds build feature descriptor to this settings object.- Specified by:
addBuildFeaturein interfaceBuildTypeSettings- Parameters:
feature- build feature descriptor
-
getBuildFeatures
@NotNull public Collection<SBuildFeatureDescriptor> getBuildFeatures()
Description copied from interface:BuildTypeSettingsReturns build features added to this settings object.- Specified by:
getBuildFeaturesin interfaceBuildTypeSettings- Specified by:
getBuildFeaturesin interfaceResolvedSettings- Returns:
- collection of configured build features
-
getBuildFeaturesOfType
@NotNull public Collection<SBuildFeatureDescriptor> getBuildFeaturesOfType(@NotNull String featureType)
Description copied from interface:BuildTypeSettingsReturns all build features of specified type.- Specified by:
getBuildFeaturesOfTypein interfaceBuildTypeSettings- Specified by:
getBuildFeaturesOfTypein interfaceResolvedSettings- Parameters:
featureType- type of the build feature- Returns:
- see above
-
removeBuildFeature
public SBuildFeatureDescriptor removeBuildFeature(@NotNull String featureId)
Description copied from interface:BuildTypeSettingsRemoves build feature with specified id from this settings object.- Specified by:
removeBuildFeaturein interfaceBuildTypeSettings- Parameters:
featureId- id of the feature- Returns:
- removed build feature descriptor or null if there were no feature descriptor with such id
-
updateBuildFeature
public boolean updateBuildFeature(@NotNull String featureId, @NotNull String newType, @NotNull Map<String,String> newParams)Description copied from interface:BuildTypeSettingsUpdates build feature descriptor with specified id, changes type and parameters.- Specified by:
updateBuildFeaturein interfaceBuildTypeSettings- Parameters:
featureId- id of build feature descriptornewType- type of build feature descriptornewParams- parameters map- Returns:
- true if parameters of build feature descriptor were changed (descriptor with such id exists) and false otherwise
-
findBuildFeatureById
@Nullable public SBuildFeatureDescriptor findBuildFeatureById(@NotNull String featureId)
Description copied from interface:BuildTypeSettingsReturns build feature with specified id- Specified by:
findBuildFeatureByIdin interfaceBuildTypeSettings- Parameters:
featureId- id of the feature- Returns:
- see above
-
setEnabled
public void setEnabled(@NotNull String paramsDescriptorId, boolean enabled)Description copied from interface:BuildTypeSettingsEnables or disables descriptor with specified id in build configuration settings. This method can be used to enable or disable build runners, triggers and build features.- Specified by:
setEnabledin interfaceBuildTypeSettings- Parameters:
paramsDescriptorId- id of build runner, trigger or build featureenabled- true to enable, false to disable
-
isEnabled
public boolean isEnabled(@NotNull String paramsDescriptorId)Description copied from interface:BuildTypeSettingsReturns true if descriptor with specified id (runner, trigger or build feature) is enabled and false otherwise.- Specified by:
isEnabledin interfaceBuildTypeSettings- Parameters:
paramsDescriptorId- id of build runner, trigger or build feature
-
removeAllBuildRunners
public void removeAllBuildRunners()
Description copied from interface:BuildTypeExRemoves all build runners- Specified by:
removeAllBuildRunnersin interfaceBuildTypeEx- Specified by:
removeAllBuildRunnersin interfaceBuildTypeSettings
-
getRunnersOrder
@Nullable public String[] getRunnersOrder()
- Specified by:
getRunnersOrderin interfaceBuildTypeSettings- Returns:
- runner ids in their custom order (if such order is set), null otherwise
-
persist
public void persist(@Nullable String comment)
-
getLastConfigModificationAction
public AuditLogAction getLastConfigModificationAction()
- Specified by:
getLastConfigModificationActionin interfaceBuildTypeEx
-
getConfigurationFile
@NotNull public File getConfigurationFile()
Description copied from interface:BuildTypeIdentityReturns the configuration file where this build type or template is persisted (or will be persisted to).- Specified by:
getConfigurationFilein interfaceBuildTypeIdentity- Specified by:
getConfigurationFilein interfaceSPersistentEntity- Returns:
- see above.
-
getConfigurationFile
@NotNull public File getConfigurationFile(@NotNull File projectsDir)
Description copied from interface:SPersistentEntityReturns the configuration file where this entity is persisted in custom projects directory- Specified by:
getConfigurationFilein interfaceSPersistentEntity- Parameters:
projectsDir- path to teamcity projects directory- Returns:
- see above
-
getVcsRootInstanceEntries
@NotNull public List<VcsRootInstanceEntry> getVcsRootInstanceEntries()
- Specified by:
getVcsRootInstanceEntriesin interfaceSBuildType- Returns:
- resolved VCS root entries (entries with resolved settings: VCS root parameters and checkout rules).
-
getVcsRootInstanceEntries
@NotNull public List<VcsRootInstanceEntry> getVcsRootInstanceEntries(boolean includeSettingsRoot)
Description copied from interface:BuildTypeExReturns entries for VCS roots attached to this buildType. If buildType has an implicit settings root (not attached to buildType) andincludeSettingsRootistrue, then an entry for this settings root is included in the result.- Specified by:
getVcsRootInstanceEntriesin interfaceBuildTypeEx- Parameters:
includeSettingsRoot- whether settings root should be included in result- Returns:
- see above
-
isImplicitSettingsRoot
public boolean isImplicitSettingsRoot(@NotNull VcsRootInstance root)Description copied from interface:BuildTypeExReturns true if the specified VCS root is an implicit settings root, ie. this buildType's project stores settings in this root and root is not attached to this buildType- Specified by:
isImplicitSettingsRootin interfaceBuildTypeEx- Parameters:
root- root of interest- Returns:
- see above
-
getVcsRootInstanceEntries
@NotNull public List<VcsRootInstanceEntry> getVcsRootInstanceEntries(@NotNull Set<String> vcsNames, boolean includeSettingsRoot)
Description copied from interface:SBuildTypeReturns entries corresponding to specified vcs support names- Specified by:
getVcsRootInstanceEntriesin interfaceSBuildType- Parameters:
vcsNames- VCS support namesincludeSettingsRoot- whether settings root should be included in result- Returns:
- see above
-
getVcsRootInstanceForParent
public VcsRootInstance getVcsRootInstanceForParent(@NotNull SVcsRoot parentRoot)
- Specified by:
getVcsRootInstanceForParentin interfaceSBuildType- Returns:
- VCS root instance for specified parentRoot. Parent VCS root must be attached to this configuration, otherwise null will be returned.
-
getVcsRootInstanceEntryForParent
@Nullable public VcsRootInstanceEntry getVcsRootInstanceEntryForParent(@NotNull SVcsRoot parentRoot)
- Specified by:
getVcsRootInstanceEntryForParentin interfaceSBuildType- Returns:
- VCS root instance entry for specified parentRoot. Parent VCS root must be attached to this configuration, otherwise null will be returned.
-
getVcsRootInstances
@NotNull public List<VcsRootInstance> getVcsRootInstances()
- Specified by:
getVcsRootInstancesin interfaceSBuildType- Returns:
- collection of VCS root instances used in this build configuration.
-
applyRunnersOrder
public void applyRunnersOrder(@NotNull String[] ids)Description copied from interface:BuildTypeSettingsAccepts array of runner identifiers and reorders them according to this array.- Specified by:
applyRunnersOrderin interfaceBuildTypeSettings- Parameters:
ids- runner identifiers
-
resetRunnersOrder
public void resetRunnersOrder()
Description copied from interface:BuildTypeSettingsResets custom runner order to default.- Specified by:
resetRunnersOrderin interfaceBuildTypeSettings
-
intersectsWith
public boolean intersectsWith(@NotNull Dependent dependent)Description copied from interface:DependentReturns true if this object dependencies intersect (have same nodes) with specified object dependencies.- Specified by:
intersectsWithin interfaceDependent- Parameters:
dependent- another object- Returns:
- see above
-
compareTo
public int compareTo(@NotNull BuildTypeDescriptor o)- Specified by:
compareToin interfaceComparable<BuildTypeDescriptor>
-
getBuildSettings
@NotNull public BuildSettings getBuildSettings()
Description copied from interface:BuildTypeExReturns build settings: settings for build (where excluded disabled options and features).- Specified by:
getBuildSettingsin interfaceBuildTypeEx- Returns:
- build settings.
-
setExternalId
public void setExternalId(@NotNull String newExternalId) throws InvalidIdentifierException, DuplicateExternalIdExceptionDescription copied from interface:BuildTypeIdentityChanges the external id of this build template or build configuration.This method persists the current entity, and can persist also dependent entities.
- Specified by:
setExternalIdin interfaceBuildTypeIdentity- Parameters:
newExternalId- new external identifier. Must be unique (case insensitively) in the scope of all build templates and build configurations (in other words, two projects with build configurations with same external id are not allowed).- Throws:
InvalidIdentifierException- wrong identifierDuplicateExternalIdException- a build template or a build configuration
-
setExternalId
public void setExternalId(@NotNull ConfigAction cause, @NotNull String newExternalId) throws InvalidIdentifierException, DuplicateExternalIdExceptionDescription copied from interface:BuildTypeIdentityChanges the external id of this build template or build configuration.This method persists the current entity, and can persist also dependent entities.
- Specified by:
setExternalIdin interfaceBuildTypeIdentity- Parameters:
cause- configuration action caused the changenewExternalId- new external identifier. Must be unique (case insensitively) in the scope of all build templates and build configurations (in other words, two projects with build configurations with same external id are not allowed).- Throws:
InvalidIdentifierException- wrong identifierDuplicateExternalIdException- a build template or a build configuration
-
listFiles
@NotNull public List<VcsFile> listFiles(@NotNull String relativePath) throws VcsException
Description copied from interface:VcsWorkspaceAccessLists files in the directory specified by relativePath- Specified by:
listFilesin interfaceVcsWorkspaceAccess- Parameters:
relativePath- relative path regarding to the project root, "checkout root" from vcs root should not be included- Returns:
- list of files in directory
- Throws:
VcsException- if some problem occurred while listing files or when files cannot be listed (canListFiles() returns false)
-
canListFiles
public boolean canListFiles()
- Specified by:
canListFilesin interfaceVcsWorkspaceAccess- Returns:
- true if list files is possible, false otherwise
-
belongsTo
public boolean belongsTo(@NotNull SProject project)Description copied from interface:BuildTypeIdentityChecks whether this build type or template belongs to the specified project or one of its subprojects, transitively.- Specified by:
belongsToin interfaceBuildTypeIdentity- Specified by:
belongsToin interfaceSBuildType- Parameters:
project- the project to check this configuration to belongs to.- Returns:
- true if belongs.
-
getOwnVcsRootEntries
@NotNull public List<VcsRootEntry> getOwnVcsRootEntries()
- Specified by:
getOwnVcsRootEntriesin interfaceSBuildType- Returns:
- build configuration own VCS roots, i.e. it does not contain VCS roots inherited from template
-
getParent
@Nullable public SPersistentEntity getParent()
Description copied from interface:SPersistentEntityThe parent entity.- Specified by:
getParentin interfaceSPersistentEntity- Returns:
- see above.
-
getTags
@NotNull public List<String> getTags(@NotNull SUser user)
Description copied from interface:BuildTypeExList of all private tags set for builds of this configuration by the specified user.- Specified by:
getTagsin interfaceBuildTypeEx- Returns:
- union of tags for each build for the configuration.
-
getDummyBuild
@NotNull public DummyBuild getDummyBuild()
- Specified by:
getDummyBuildin interfaceBuildTypeEx
-
getDummyBuildPromotion
@NotNull public DummyBuildPromotion getDummyBuildPromotion()
- Specified by:
getDummyBuildPromotionin interfaceBuildTypeEx
-
getDummyBuildPromotion
@Nullable public DummyBuildPromotion getDummyBuildPromotion(boolean createIfNotExists)
- Specified by:
getDummyBuildPromotionin interfaceBuildTypeEx
-
resetPendingChanges
public void resetPendingChanges()
- Specified by:
resetPendingChangesin interfaceBuildTypeEx
-
getArtifactDirectories
@NotNull public List<File> getArtifactDirectories()
- Specified by:
getArtifactDirectoriesin interfaceBuildTypeEx- Returns:
- list of directories where artifacts of builds of this build type are stored. List always has at least one element. The first directory in the list is a directory where new builds store their artifacts.
-
createEditableCopy
@NotNull public BuildTypeEx createEditableCopy(boolean fillSettings)
- Specified by:
createEditableCopyin interfaceBuildTypeEx
-
getOwnParameter
@Nullable public Parameter getOwnParameter(@NotNull String paramName)
- Specified by:
getOwnParameterin interfaceInheritableUserParametersHolder- Parameters:
paramName- parameter name- Returns:
- own parameter with given name or null if there is no such parameter
-
getOwnParametersWithoutInheritedSpec
@NotNull public Collection<Parameter> getOwnParametersWithoutInheritedSpec()
- Specified by:
getOwnParametersWithoutInheritedSpecin interfaceInheritableUserParametersHolder- Returns:
- own parameters as is, with own parameters spec.
-
getInheritedParametersCollection
@NotNull public Collection<Parameter> getInheritedParametersCollection()
- Specified by:
getInheritedParametersCollectionin interfaceInheritableUserParametersHolder- Returns:
- collection of inherited parameters.
-
getOwnNonInheritedParameter
@Nullable public Parameter getOwnNonInheritedParameter(@NotNull String paramName)
Description copied from interface:InheritableUserParametersHolderExOwn parameter without inherited parameter spec.- Specified by:
getOwnNonInheritedParameterin interfaceInheritableUserParametersHolderEx- Returns:
-
getVersion
@NotNull public PersistentEntityVersion getVersion()
Description copied from interface:SPersistentEntityReturns version of this entity which can be used to check if the entity was edited or persisted.- Specified by:
getVersionin interfaceSPersistentEntity- Returns:
- see above
-
markPersisted
public void markPersisted(long expectedEditId)
Description copied from interface:SPersistentEntityMarks entity as persisted- Specified by:
markPersistedin interfaceSPersistentEntity- Parameters:
expectedEditId- expected editId in the end of persist. The entity will be marked as unedited if expected editId is the same as actual, ie. the entity wasn't edited while persist was running
-
createConfigAction
@NotNull public ConfigAction createConfigAction(@Nullable SUser user, @NotNull String description)
Description copied from interface:SPersistentEntityCreates a config action instance associated with this entity and having the specified description. The config action object can be used inSPersistentEntity.schedulePersisting(ConfigAction)orSPersistentEntity.scheduleRemove(ConfigAction)methods to describe the performed action.- Specified by:
createConfigActionin interfaceSPersistentEntity- Parameters:
user- user who performs operation, or null if operation is performed by the systemdescription- description to set to the config action object- Returns:
- new config action
-
isDefaultBranchExcluded
public boolean isDefaultBranchExcluded()
Description copied from interface:BuildTypeExReturns true default branch is excluded in the build configuration branch filter- Specified by:
isDefaultBranchExcludedin interfaceBuildTypeEx- Returns:
- see above
-
getBuildTypeBranchFilter
@NotNull public BranchFilter getBuildTypeBranchFilter()
- Specified by:
getBuildTypeBranchFilterin interfaceSBuildType- Returns:
- default branch filter which is applied to all branches available in this configuration since 2019.1
-
getBuildTypeBranchFilterUnsafe
@NotNull public BranchFilter getBuildTypeBranchFilterUnsafe() throws InvalidBranchSpecException
Description copied from interface:BuildTypeExSame asSBuildType.getBuildTypeBranchFilter()but throws an exception if the branch filter is incorrect- Specified by:
getBuildTypeBranchFilterUnsafein interfaceBuildTypeEx- Throws:
InvalidBranchSpecException
-
getRelatedVcsRootInstanceIds
@NotNull public Set<Long> getRelatedVcsRootInstanceIds()
Description copied from interface:BuildTypeExReturns ids of VCS root instances which reported changes associated with this build configuration.- Specified by:
getRelatedVcsRootInstanceIdsin interfaceBuildTypeEx- Returns:
-
isVirtual
public boolean isVirtual()
- Specified by:
isVirtualin interfaceSBuildType- Specified by:
isVirtualin interfaceSPersistentEntity- Returns:
- true if this entity is auto-generated and can be regenerated or removed by the server at any point of time,
see also
SProject.isVirtual()
-
getExcludedDefaultRootInstanceIds
@NotNull public Set<Long> getExcludedDefaultRootInstanceIds()
Description copied from interface:BuildTypeExReturns set of vcs root instance ids with excluded default branch- Specified by:
getExcludedDefaultRootInstanceIdsin interfaceBuildTypeEx- Returns:
- see above
-
isDeployment
public boolean isDeployment()
- Specified by:
isDeploymentin interfaceBuildTypeSettings- Returns:
- true if this build configuration is doing deployment
-
getRunBuildActionName
public String getRunBuildActionName()
- Specified by:
getRunBuildActionNamein interfaceBuildTypeEx- Returns:
- name of the Run build action in this configuration, this could be Run, Deploy, Upload, etc. The primary usage of this name is web interface.
-
isCompositeBuildType
public boolean isCompositeBuildType()
- Specified by:
isCompositeBuildTypein interfaceBuildTypeEx- Specified by:
isCompositeBuildTypein interfaceBuildTypeSettings- Returns:
- true if this build type is composite
-
isAgentLessBuildType
public boolean isAgentLessBuildType()
- Specified by:
isAgentLessBuildTypein interfaceBuildTypeEx- Returns:
- true if this build type is agent less
-
isEmptyUuid
public boolean isEmptyUuid()
- Specified by:
isEmptyUuidin interfaceBuildTypeEx- Returns:
- true if this buildType has an empty uuid in its config on disk
-
reassignIntId
public void reassignIntId(@NotNull String internalId)Description copied from interface:BuildTypeExAssigns the specified internalId to this buildType. The internalId should come from an entityId present in DB and marked as removed, otherwise anIllegalArgumentExceptionis thrown.- Specified by:
reassignIntIdin interfaceBuildTypeEx
-
containsOwnVcsRoot
public boolean containsOwnVcsRoot(long vcsRootId)
Description copied from interface:BuildTypeSettingsReturns true if VCS root with specified id is attached directly and is not inherited via a template- Specified by:
containsOwnVcsRootin interfaceBuildTypeEx- Specified by:
containsOwnVcsRootin interfaceBuildTypeSettings- Parameters:
vcsRootId- vcs root id- Returns:
- true if the specified VCS root is attached to the build configuration directly and is not inherited
-
updateRevisionsForOwnBranches
public void updateRevisionsForOwnBranches(@NotNull Collection<String> logicalBranchNames)Description copied from interface:BuildTypeExMake sure that revisions for specified logical branches are calculated and saved in dummy build promotions. These revisions are used to compute pending changes, so if some code is going to compute pending changes for a big amount of branches it makes sense to call this method first.- Specified by:
updateRevisionsForOwnBranchesin interfaceBuildTypeEx
-
setSettings
public void setSettings(@NotNull BuildTypeSettingsEx newSettings)Description copied from interface:BuildTypeExComplete replacement of settings- Specified by:
setSettingsin interfaceBuildTypeEx- Parameters:
newSettings- new settings
-
-