Extend pipeline project congfiguration page

16 views
Skip to first unread message

David Wilhelm

unread,
Jul 3, 2017, 8:40:23 AM7/3/17
to Jenkins Users
Hi,

I'm building a plugin that listens for job deletions and notifies the Sonarqube Server about that. 

Background: I use feature branches with complete sonarqube scans. Jenkins creates a new job for every branch and the sonarscanner does the same on sonarqube. If a branch gets deleted, jenkins deletes the corresponding job, but the sonarqube jobs stay resulting in 100 and more orphaned jobs on sonarqube. I would like to have the sonar projects deleted, too. 

So I started coding an plugin which listens for job deletions and then sends requests to sonarqube web api. 
So far so good, now I need to make my plugin configurable as there may also be projects that do not use sonarqube scanning.

I would like to "simply" add an entry to the per project configuration page where i can enable my pluign. I'm having trouble finding a way to do that with multibranch pipeline, i just managed to do that with an "Freestyle project" by implementing a custom builder.

Can anyone give me a hint or help me to get this done! Or should I do that otherwise?
I would really appreciate your help a lot!

Thanks in advance,
David

Daniel Beck

unread,
Jul 3, 2017, 3:31:28 PM7/3/17
to jenkins...@googlegroups.com

> On 3. Jul 2017, at 11:29, David Wilhelm <david....@qaware.de> wrote:
>
> I would like to "simply" add an entry to the per project configuration page where i can enable my pluign. I'm having trouble finding a way to do that with multibranch pipeline, i just managed to do that with an "Freestyle project" by implementing a custom builder.
>

Probably best done as a JobProperty if you want to define it in the Pipeline DSL. Otherwise it's unclear what you mean 'per project config page', as it's read-only for MBPLs.

Note that questions like this should be asked on the jenkinsci-dev mailing list.

Reply all
Reply to author
Forward
0 new messages