Is there a way to enable or disable job dynamically in runtime in Bamboo just like conditional tasks?
One of the dirty solutions I am thinking is to create a wrapper build plan that would read the parameters/variables and based on the variables (e.g enableJob1, enableJob2... enableJob3 - these would be true or false), do followings:
1) create java spec in run time
2) push the spec and create (or update) the plan itself
3) run the updated plan
Not sure I am overthinking or is there any other good way to solve this.
Yes, I understand Plan within Plan to tackle it. Your purpose would be solved but this solution would not be a good practice to follow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the reply. I am using Bamboo 7.2.3 deployed in a local vm. Unfortunately the link you have shared is not what I am looking for.
Let me try to explain it more. I have a bamboo plan that has a number of jobs within a stage and each job has a number of tasks. The reason to have a number of jobs is to run them in parallel when required. Based on our need, we manually enable / disable the jobs before we execute the plan.
I want to move away from this behaviour and provide conditional execution of jobs. My thought was to use java spec and do one of the following:
i) either populate job (.Stage.jobs(job1, job2, ... jobN)
or
ii) enable/disable job (job1.enable(false), job2.enable(true).. and so on)
I am almost reaching to a conclusion that this is not possible as I cannot read variable outside task.
Not sure if there is another way to do it. I dont want to use conditional tasks as this will require to run stage even if i have to skip all the tasks (assuming i wanted to disable the sage).
Hope this makes it clear.
-Pawan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Pawan Shrestha ,
Thanks for posting this in community.
I am not sure which version you are using, but I think this would solve your query (i.e. stopping an active job build) - https://confluence.atlassian.com/bamboo/stopping-an-active-build-289276913.html
Please accept the answer if it solves your query else please respond an allow others to share input.
Stay safe and healthy.
Cheers
Suvradip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for super late reply but this is not what i am looking for. I dont want the build to be stopped but to selectively run jobs within a build.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.