Customize build email based on compiler warnings

Hello,

I would like to modify the standard bamboo build email to include information about compiler warnings.

For example, instead of this:

#10 was successful

100 tests in total.

I want to say this:

#10 was successful but with warnings

100 tests in total.

5 compiler warnings in total.

We use Maven task to complie our code and I've enabled complier warnings output in the project's POM.

I've also read Bamboo documenation on how to customize email notification message and confirmed that by modifying ChainCompletedHtmlEmail.ftl, I can get my email customized.

Now I need to figure out how to pass information about compiler warnings from Maven and use it in the build email.

Any suggestions will be appreciated.

Thanks,

Michael

1 answer

This widget could not be displayed.

Well, I think it's possible provided you have access to Bamboo source distro and you are not afraid of some coding...

The way I would do it is to create new Task Plugin using existing Bamboo Maven Task as a base. Code can be found in Bamboo source distribution.

The modifications would be:

- adding code to the output handler that would parse the Maven warning information

- add warning count (and whatever else you need) to results' custom data. Sth like that:

public TaskResult execute(@NotNull final TaskContext taskContext) throws TaskException {

///... maven stuff here
  taskContext.getBuildContext().getBuildResult().getCustomBuildData().put("warningCount", warningCount));
}

- custom data get's saved with JobResultsSummary and you should be able to access it in notification ftl

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

150 views 2 0
Join discussion

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