Interface BuildCustomizer

    • Method Detail

      • getBuildType

        @NotNull
        SBuildType getBuildType()
        Returns:
        build configuration to which custom build belongs.
      • getCurrentUser

        @Nullable
        SUser getCurrentUser()
        Returns:
        user set to customizer during customizer instance creation.
      • setParameters

        void setParameters​(@NotNull
                           Map<String,​String> customParams)
        Sets custom parameters to the build, custom parameters will overwrite default parameters inherited from build configuration.
        Parameters:
        customParams - custom parameters map
      • addParametersIfAbsent

        void addParametersIfAbsent​(@NotNull
                                   Map<String,​String> params,
                                   boolean passToDependencies)
        Add parameters which should be passed to the build and probably to its dependencies, too
        Parameters:
        params - parameters, passed but do not overwrite already present ones
        passToDependencies - if set, the parameters will be set on dependencies, too
        Since:
        2021.2.2
      • setAttributes

        void setAttributes​(@NotNull
                           Map<String,​String> attributes)
        Sets custom attributes to the build
        Parameters:
        attributes - custom attributes map
      • setRebuildDependencies

        void setRebuildDependencies​(boolean rebuild)
        Sets whether all snapshot dependencies must be rebuild or not. This is the same as to set option DependencyOptions.TAKE_STARTED_BUILD_WITH_SAME_REVISIONS to false for all snapshot dependencies.
        Parameters:
        rebuild - true to rebuild all dependencies
      • setRebuildDependencies

        void setRebuildDependencies​(@NotNull
                                    Collection<String> buildTypeIds)
        Specifies collection of build configurations where builds cannot be reused. Similar to setRebuildDependencies(boolean) but works for a specific set of nodes. Note that setRebuildDependencies(boolean) (true) has higher priority.
        Parameters:
        buildTypeIds - ids of build configurations where builds reusing is disabled
      • setBuildComment

        void setBuildComment​(@NotNull
                             String buildComment)
        Sets comment to the build. If comment is specified but user was not set to this customizer IllegalArgumentException is thrown.
        Parameters:
        buildComment - comment to set
      • setChangesUpTo

        void setChangesUpTo​(@NotNull
                            SVcsModification modification)
        Specifies the last change to include in this build.
        Parameters:
        modification - the last change to include in the build
      • setPersonal

        void setPersonal​(boolean personal)
        If personal is true the personal build will be created with owner set to user who performs the action. If personal is true but user was not set to this customizer IllegalArgumentException is thrown.
        Parameters:
        personal - true for personal build, false otherwise
      • setPersonalChangeId

        void setPersonalChangeId​(long changeId)
        Sets id of a personal patch should be associated with the personal build.
        Parameters:
        changeId - personal patch id
        Since:
        2019.1
      • setArtifactDependencies

        void setArtifactDependencies​(@NotNull
                                     List<SArtifactDependency> customDependencies)
        Sets custom artifact dependencies to the build. Custom dependencies will overwrite default dependencies completely.
        Parameters:
        customDependencies - collection of custom artifact dependencies
      • setSnapshotDependencyNodes

        void setSnapshotDependencyNodes​(@NotNull
                                        Collection<BuildPromotion> promotions)
        Sets custom nodes for the snapshot dependency graph. Each custom node will replace existing one for the same build configuration.
        Parameters:
        promotions - nodes to insert in the snapshot dependency graph
      • setCleanSources

        void setCleanSources​(boolean cleanSources)
        If cleanSources is true the build will re-checkout all the sources on agent (note: this setting does not affect snapshot dependencies anyhow).
        Parameters:
        cleanSources - true to re-checkout sources on agent.
      • setDesiredBranchName

        void setDesiredBranchName​(@NotNull
                                  String branchName)
        Sets the desired branch name for the build promotion (will be propagated to the whole snapshot dependency graph).
        Parameters:
        branchName - the branch name - empty string or display name of the default branch means default branch
        Since:
        7.1
      • createPromotion

        @NotNull
        BuildPromotion createPromotion()
        Creates build promotion with all custom settings. Created build promotion can be added to the queue.
        Returns:
        new build promotion
        Throws:
        RuntimeException - if some problem occurred
      • setTagDatas

        void setTagDatas​(@NotNull
                         Set<TagData> tags)
        Sets build tags
        Since:
        9.0