Pre/Post Build Command Plugin isn't Pre/Post Build - or am I missing something?

Ken Wood
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.
September 24, 2012

I added the Pre/Post Build Command Plugin to my testbed instance of Bamboo 3.4.3

What I found is that the pre and post build command is available IN A JOB.

I want an action that is before the first stage of the build plan and after the last stage of the build plan, not something before and after a job. I.e. something that is pre-the-build and post-the-build, not pre-job and post-job...

Is there a configuration option I missed somewhere?

2 answers

1 accepted

1 vote
Answer accepted
James Dumay
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.
September 25, 2012

Hi Kenneth, it only works for Jobs not Plans. I've opened up a feature request for you to add support for this. Please watch and vote for it :)

Ken Wood
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.
September 25, 2012

I voted for it, and I added a use case in the comments:

Here is my use case: I have a resource shared across several build plans. Each build plan needs exclusive access to the resource. I cannot use agent capabilities and job requirements 'trick' to control access to the resource because, across the different stages of the build plan, a number of different remote agents need to be used.

I could use a semaphore file approach to lock access to the resource via a script at the beginning of the build, and unlock it at the end of the build. But, if the build fails somewhere in between or if the build is stopped, the resource would never be unlocked. I could add 'final task' to every job to release the resource, but then in the next stage I would need to re-acquire the resource. That leaves open the possibility that, between the task that released the resource and the task the re-acquires it, another build plan that was waiting on the resource could acquire it instead, disrupting this build plan.

Thus, I really need an action PRE the first stage of the build that can acquire lock on the resource, and a POST last stage (regardless of build success or failure) that can release the resource.

0 votes
Oleksandr Presich July 18, 2013

Hi Ken, please advise if you have found a way to run PRE/POST stage commands. Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events