Can a Bamboo Plugin manipulate the build command(s)?

I am trying to write a Bamboo plugin that will automatically manipulate the build commands, in order to automatically instrument them and capture various logs and outputs in order to run static analysis.

I see that there used to be a CommandDecorator class available to the plugins, but not available in latest Bamboo.

I could alternatively just find source code in the working directory and analyze that, like other plugins must do, but that has the disadvantage of not following the build as it downloads dependencies from various places (not typically stored in the working directory). This lowers the precision and accuracy of analysis.

The only alternative I can think of is requiring /some/ manual configuration of the user's build commands, and then the plugin would pick that up and do the remaining actions automatically... But that doesn't feel like a good user experience.

Thanks!

1 answer

0 vote
Daniel Wester Community Champion Jun 21, 2017

You might want to ask this question over at community.developers.atlassian.com where there are a bunch of other addon developers like us. :)

That said,

It depends on what you're trying to do. One approach might be to write a new Task that wraps the CommandTask (or whichever task you're wanting to instrument). 

Depending on what you're doing though - you could just write a PostJob module:

https://developer.atlassian.com/bamboodev/bamboo-plugin-guide/bamboo-plugin-module-types/build-lifecycle-plugin-modules/post-job-action-module

That way you can get hold of the logs and instrument them there.

You can also do a Pre-Job approach:

https://developer.atlassian.com/bamboodev/bamboo-plugin-guide/bamboo-plugin-module-types/build-lifecycle-plugin-modules/pre-job-action-module

and just edit the build contexts on the fly that way... But that might be slightly painful.

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,670 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you