Development Question Build action vs Post Build action

32 views
Skip to first unread message

JordanGS

unread,
Apr 13, 2017, 6:18:30 PM4/13/17
to Jenkins Developers
We have a build step that run an application, does a bunch of stuff, generates some reports and outputs a bunch of data to the console.

The final report / information available during the build step is the list of all issues/alerts found. The application scans a given website for security issues and flags when with various alert levels (High, Med, Low)

So let's say that during the build step, 5 High level issues were found, 20 medium and 300 low. How do we now make this information available to a post build action? Can it even see that information?

The goal of the post build action is a threshold system, where the user defines the upper bound for each level. So if the users says 3 is the max number of highs, and there are 5 in total. Then the build will result in a failure.

But at the moment, we don't know about the 5 from the build step, how do we exchange information between the build step and the post build step. Any example or guidance would be greatly appreciated. Is it even possible for the Build step to send information to the post build step?

JordanGS

unread,
Apr 13, 2017, 6:37:06 PM4/13/17
to Jenkins Developers
Per IRC discussion, i was refereed to: Actions

"add an action in your build step (thinking about what it means when there is already one, same build step twice, and how to handle that), then check for an action of that type in the post-build step"

"in perform(…) of the build step: build.addAction(new MyAction()) ; then in perform(…) of the publisher: build.getAction(MyAction.class)"

Requires more investigation and an attempt to get working, will update if i run into issues. Thanks Daniel :)
Reply all
Reply to author
Forward
0 new messages