سؤال

I'm developing a plugin which I need to run on every single project in my Jenkins cluster. I need a way to ensure it is added by default when new projects are created (I can use groovy to add it to the existing projects).

I know from developing another plugin in the past, with ListViewColumn there is a shownByDefault() in the descriptor. I can't seem to find an equivalent for Recorder/Notifier/Publisher... although I'm happy to use any other class providing I can have the logic run after a build and add a BadgeAction.

Thanks

هل كانت مفيدة؟

المحلول 2

This can be achieved by implementing hudson.model.listeners.ItemListener.

It has onLoaded(), onCreated(Item item), onUpdated(Item item), which can be used to add in this case a Notifier to the project... the Item can be casted to AbstractProject, then getPublishersList().add(instance to add).

Don't forget when modifying the build or project objects in this way to call .save() to ensure your changes are persisited.

نصائح أخرى

Will Inheritance and Template plugins suffice?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top