Class Plan

    • Constructor Detail

      • Plan

        public Plan​(@NotNull
                    @NotNull Plan copy)
      • Plan

        public Plan​(@NotNull
                    @NotNull Project project,
                    @NotNull
                    @NotNull java.lang.String name,
                    @NotNull
                    @NotNull java.lang.String key)
             throws PropertiesValidationException
        Specify plan with given project, name and key.

        If oid is not specified, key serves as a plan identifier. If a plan with specified key does not exist, a new one is created, otherwise it is updated.

        When defining a Specs branch, these parameters should identify the master plan. Plan branch key and name are generated automatically.

        Parameters:
        project - project this plan belongs to. Project must exist.
        name - plan's name
        key - plan's short key, must be unique within the project.
        Throws:
        PropertiesValidationException
        See Also:
        oid(String)
      • Plan

        public Plan​(@NotNull
                    @NotNull Project project,
                    @NotNull
                    @NotNull java.lang.String name,
                    @NotNull
                    @NotNull BambooKey key)
             throws PropertiesValidationException
        Specify plan with given project, name and key.

        If oid is not specified, key serves as a plan identifier. If a plan with specified key does not exist, a new one is created, otherwise it is updated.

        When defining a Specs branch, these parameters should identify the master plan. Plan branch key and name are generated automatically.

        Parameters:
        project - project this plan belongs to. Project must exist.
        name - plan's name
        key - plan's short key, must be unique within the project.
        Throws:
        PropertiesValidationException
        See Also:
        oid(String)
    • Method Detail

      • key

        public Plan key​(@Nullable
                        @Nullable java.lang.String key)
                 throws PropertiesValidationException
        Sets the plan's key.

        If oid is not specified, key serves as a plan identifier. If a plan with specified key does not exist, a new one is created, otherwise it is updated.

        When defining a Specs branch, should identify the master plan. Plan branch key and name are generated automatically.

        Parameters:
        key - plan's short key, must be unique within the project.
        Throws:
        PropertiesValidationException
        See Also:
        oid(String)
      • key

        public Plan key​(@Nullable
                        @Nullable BambooKey key)
                 throws PropertiesValidationException
        Sets the plan's key.

        If oid is not specified, key serves as a plan identifier. If a plan with specified key does not exist, a new one is created, otherwise it is updated.

        When defining a Specs branch, should identify the master plan. Plan branch key and name are generated automatically.

        Parameters:
        key - plan's short key, must be unique within the project.
        Throws:
        PropertiesValidationException
        See Also:
        oid(String)
      • oid

        public Plan oid​(@Nullable
                        @Nullable java.lang.String oid)
                 throws PropertiesValidationException
        Sets the plans's oid.

        If set, it is used to identify the plan. If a plan with specified oid does not exist, a new one is created, otherwise it is updated.

        When defining a Specs branch, should identify the master plan. Oid of a plan branch is generated automatically.

        Throws:
        PropertiesValidationException
      • oid

        public Plan oid​(@Nullable
                        @Nullable BambooOid oid)
                 throws PropertiesValidationException
        Sets the plans's oid.

        If set, it is used to identify the plan. If a plan with specified oid does not exist, a new one is created, otherwise it is updated.

        When defining a Specs branch, should identify the master plan. Oid of a plan branch is generated automatically.

        Throws:
        PropertiesValidationException
      • stages

        public Plan stages​(@NotNull
                           @NotNull Stage... stages)
        Adds the stages to the end of stages list. The order of stages is preserved.
      • planRepositories

        public Plan planRepositories​(@NotNull
                                     @NotNull VcsRepository<?,​?>... repositories)
        Adds local repositories to this plan.

        This method will create new plan-local repository definitions for this plan. To link plan to global repositories instead, use linkedRepositories(String[]).

        The list of repositories on branches must match the master plan, that is, while the repositories can have different configuration their names must match repositories defined for the master plan.

        Redefinition of a default repository is not possible at all on Specs branch. Any such settings will be ignored and default repository will be set to match the current branch. See also RssRuntimeContext.getCurrentRssBranch()

      • linkedRepositories

        public Plan linkedRepositories​(@NotNull
                                       @NotNull java.lang.String... repositoriesNames)
        Adds linked repositories with given names to this plan.

        This method will link existing global repositories to this plan. To add plan-local repository definitions instead, use planRepositories(VcsRepository[]).

        The list of repositories on branches must match the master plan, that is, while the repositories can have different configuration their names must match repositories defined for the master plan.

        On branch: in order to avoid unnecessary redefinition of a plan repository, this method can be also used to reference it.

      • projectRepositories

        public Plan projectRepositories​(@NotNull
                                        @NotNull java.lang.String... repositoriesNames)
        Adds project repositories with given names to this plan. Available for Bamboo DC only.

        This method will link existing project repositories to this plan. To add plan-local repository definitions instead, use planRepositories(VcsRepository[]).

        The list of repositories on branches must match the master plan, that is, while the repositories can have different configuration their names must match repositories defined for the master plan.

        On branch: in order to avoid unnecessary redefinition of a plan repository, this method can be also used to reference it.

        Since:
        8.0
      • repositoryBranches

        public Plan repositoryBranches​(@NotNull
                                       @NotNull VcsRepositoryBranch... repositoryBranches)
        Defines which branches should be built by this plan or plan branch. Arguments can reference any repository attached to the plan (local or linked).

        Redefinition of a default repository is not possible at all on Specs branch. Any such settings will be ignored and default repository will be set to match the current branch. See also RssRuntimeContext.getCurrentRssBranch()

      • triggers

        public Plan triggers​(@NotNull
                             @NotNull Trigger<?,​?>... triggers)
        Adds triggers to this plan.
      • clearTriggers

        public Plan clearTriggers()
        Clears all previously added triggers to this plan.
      • variables

        public Plan variables​(@NotNull
                              @NotNull Variable... variables)
        Adds plan variables.
      • noDependencies

        @Deprecated
        public Plan noDependencies()
        Deprecated.

        Use this method to specify that your plan has no dependencies. If you have dependencies on other plans specified in Bamboo and you use this method in Bamboo Specs, your existing plan dependencies will be cleaned. Introduced for migration option for plans created via Specs in Bamboo 6.0.

        If your plan doesn't have dependencies on other plans, don't configure any dependencies. No need to explicit using this method.

      • pluginConfigurations

        public Plan pluginConfigurations​(@NotNull
                                         @NotNull PluginConfiguration<?>... pluginConfigurations)
        Appends plugin configuration to the plan. If the same plugin is specified second time, its configuration is overwritten.

        Ignored on branches.

      • noPluginConfigurations

        @Deprecated
        public Plan noPluginConfigurations()
        Deprecated.

        Use this method to specify that your plan has default plugins configuration. If you have any plugin configuration specified in Bamboo and you use this method in Bamboo Specs, your existing plan plugin configuration will be cleaned. Introduced for migration option for plans created via Specs in Bamboo 6.0.

        If you want to have default plugin configuration for your plan, don't introduce any plugin configuration. No need to explicit using this method.

      • notifications

        public Plan notifications​(@NotNull
                                  @NotNull Notification... notifications)
        Appends a notification rule to the plan.
      • clearNotifications

        public Plan clearNotifications()
        Clears all notifications previously added to this plan.
      • noNotifications

        @Deprecated
        public Plan noNotifications()
        Deprecated.

        Use this method to specify that your plan has no notification rules. If you have notification rules specified in Bamboo and you use this method in Bamboo Specs, your existing plan notification rules will be cleaned. Introduced for migration option for plans created via Specs in Bamboo 6.0.

        If you don't want notifications for your plan, don't configure any. No need to explicitly using this method.

      • forceStopHungBuilds

        @Deprecated
        public Plan forceStopHungBuilds()
        Deprecated.
        since 9.3. Use #pluginConfigurations(new ForceStopBuild().enabled(true))
        Use this method to configure Bamboo to stop hung build and kill all processes executed by current plan. When Build Monitoring is disabled at Bamboo server validation error will be thrown.

        Ignored on branches.

      • ignoreHungBuilds

        @Deprecated
        public Plan ignoreHungBuilds()
        Deprecated.
        since 9.3. Use #pluginConfigurations(new ForceStopBuild().enabled(false))
        Use this method to ignore hung build and allow user to stop it manually.

        Ignored on branches.

      • labels

        public Plan labels​(@NotNull
                           @NotNull java.lang.String... labels)
        Adds labels to this plan.
      • labels

        public Plan labels​(@NotNull
                           @NotNull Label... labels)
        Adds labels to this plan.
      • noLabels

        @Deprecated
        public Plan noLabels()
        Deprecated.
        Use this method to specify that your plan has no labels. If you have any labels added to your plan in Bamboo and you use this method in Bamboo Specs, your existing labels will be cleaned. Introduced for migration option for plans created via Specs in Bamboo 7.0.

        If your plan doesn't need any labels, don't add eny with labels(String...) nor with labels(Label...). There's no need to explicitly call this method.

      • getIdentifier

        @NotNull
        public @NotNull PlanIdentifier getIdentifier()
        Returns identifier for this object.
        Throws:
        java.lang.IllegalStateException - if key is undefined
      • getKey

        @NotNull
        public @NotNull BambooKey getKey()
        Returns plan's key.
        Throws:
        java.lang.IllegalStateException - if key is undefined
      • getOid

        @NotNull
        public @NotNull BambooOid getOid()
        Returns plan's oid.
        Throws:
        java.lang.IllegalStateException - if oid is undefined