Is is possible to queue bamboo build if not all manual stages were executed?
Asked by sta-szek:

Is is possible to queue bamboo build if not all manual stages were executed?

Let's say I have:

1. Stage 1 (auto)
2. Stage 2 (manual)

And then I want to allow next build only when Stage 2 finished (never mind if green or red).


Answers:
author: robhit
body: Hi Piotr,

Thanks for your question!

Yes, you can do that. The steps would be:

* Set the [concurrent builds](https://confluence.atlassian.com/bamboo/configuring-concurrent-builds-289277193.html) configuration in Bamboo to allow more than 1 build at a time.
* Trigger the build. This will wait for the user input to manually start the stage 2
* At the same time, you can trigger one more build of the same plan.
* As this plan has 2 stages (1 Auto and another Manual) the new build will execute the auto stage and will wait for the user input to start the manual stage.
* So you will now have two builds triggered of the same plan in Bamboo. Both waiting for user input to trigger the manual stage. Now, if the stage fails or passes it doesn't matter. The builds are already triggered.

Hope this will help.

Thanks,

Robhit

comments: author: sta-szek
body: Hi [@robhit](/t5/user/viewprofilepage/user-id/1132242),

First of all thanks for quick answer!

I think you didn't get my question. I had in mind to limit concurrent build to **only one** , ++even if previous build is in manual waiting stage++.

Explanation:

* On Monday I trigger build no. 1.
* After 5s, someone pushed changes to repo, this should trigger build no. 2.
* Build no. 2 waits in the queue.
* Build no. 1 goes through automatic stage 1.
* Build no. 1 finished auto stage, it waits for user input in manual stage 2
* ++Build no. 2 still waits in the queue, as build no. 1 didn't finished stage 2++.
* Build no. 1 finishes stage 2.
* **Build no. 2 can start now -- both auto stage 1 and manual stage 2 were finished by build no.1**

Is that possible?


author: robhit
body: Hi [@sta-szek](/t5/user/viewprofilepage/user-id/1191672),

No, it's not possible!

Once the repository polling is triggered to get the changes and if Bamboo finds a new change added to the repo then it will trigger a new build and that build will execute the automatic stage straight ahead and then both build will wait for the user input to trigger the manual stages.

You could remove the triggers from the build plan and make it manual completely to ensure that it gets triggered only when required.

Thanks,

Robhit


author: Jeyanthan I
body: Hi [@sta-szek](/t5/user/viewprofilepage/user-id/1191672),

Is it possible for you to configure your first stage into a child plan and keep your second stage as your parent plan?

This way, you can set the option **Block build if parent builds are queued or in progress** in [Dependency blocking startegy](https://confluence.atlassian.com/bamboo/dependency-blocking-strategies-289276893.html) section, so that new builds are blocked until the existing one is executed successfully.

You may also **Enable quiet period** to queue up and aggregate multiple commits if required as explained in [this blog post.](https://www.atlassian.com/continuous-delivery/understanding-the-quiet-period)


author: sta-szek
body: Thank you for response.

Unfortunately the only satisfying answer is \`No, it's not possible!\` :(

Can you or I create a feature request? It should be really easy to implement and put into plan options.


author: sta-szek
body: [@Jeyanthan I](/t5/user/viewprofilepage/user-id/1124775) or [@robhit](/t5/user/viewprofilepage/user-id/1132242)can you provide me some more info about bamboo API, so I can develop some plugin myself?

I would like to know where is the best point to hook that, do you provide any interfaces for such a thing?


Tags: queue