Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,216
Community Members
 
Community Events
184
Community Groups

Enable/ disable jobs in stage dynamically?

Is there a way to enable or disable job dynamically in runtime in Bamboo just like conditional tasks?

3 answers

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.

Suvradip Paul
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jul 09, 2021

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.

@Suvradip Paul ,

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

0 votes
Suvradip Paul
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jul 09, 2021

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

@Suvradip Paul ,

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events