Allow one Bamboo plan to fire build execution of another plan

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: Builds, REST API, Triggers
    • None
    • 1

      Summary

      The use case is: "Plan B" has some Variables, and it needs "Plan A" to provide non-default values of those variables to "Plan B". Also, "Plan A" needs to wait to finish until the fired off build/run of "Plan B" is done, and then "Plan A" needs to finish with a red/Failed status if "Plan B" fails.

      Expected results:

      This was accomplished through 3rd party plugins such Bob Swift Atlassian Apps - Run CLI Actions in Bamboo/Bamboo Command Line Interface (CLI) as per: https://marketplace.atlassian.com/apps/5763/bamboo-command-line-interface-cli?tab=overview&hosting=datacenter. However, they did not update the plugins compatibility for Bamboo 10.x

      Workaround

      A possible workaround that involves using a Final task in the Plan and firing the Plan using a REST API:

      Fire build execution for the specified plan. Effectively, this method adds a build to the build queue, so it is not guaranteed that the build will be executed immediately. Depending on currently executed builds and length of build queue, build may be executed when queue would be drained. Additional variables could be passed to this method either as form encoded POST payload or query parameters. PLEASE note: Query parameters are more important - override those stored in the form payload. Variables defined in Bamboo as global variables or plan variables MUST be prefixed with bamboo.variable ie. bamboo.variable.myVariable=valueForMyVariable. When global or plan variables are passed to this method, they will override the default values for variables.

      curl --request POST \
        --url 'http://{baseurl}/rest/api/latest/queue/{projectKey}-{buildKey}' \
        --header 'Accept: application/json'

      However, it would not start immediately as it only adds to the build queue. If there is a dedicated agent, then it would match the requirement. We already tested and it works, we now want to verify if it's a feasible approach.

            Assignee:
            Unassigned
            Reporter:
            Lorenzo Bueno
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: