Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search for a module in all Jenkins jobs

Is it somehow possible so search for a module within all Jenkins jobs?

Let's say there's the module common-messaging. It's built in Job 1 and Job 2.

When I search for the module name I want both jobs to be shown.

like image 768
Harold L. Brown Avatar asked Oct 28 '25 08:10

Harold L. Brown


2 Answers

Jenkins store the jobs configuration on disk in XML files. So you can grep the file for whatever XML element is created by the plugin.

  • create a new job that just have that plugin enabled.
  • get the XML file: /ci/job/name_of_your_job/config.xml
  • look for an XML element that correspond to common-messaging, lets say common-messaging.plugin

Then if using a UNIX system:

grep common-messaging.plugin /var/lib/jenkins/jobs/*/config.xml

Windows must have a similar command.

like image 90
Antoine 'hashar' Musso Avatar answered Oct 30 '25 13:10

Antoine 'hashar' Musso


If you have admin access to the server, install the Scriptler plugin (which gives you more easy access to the Groovy console), and fetch and run this shared Scriptler snippet: http://scriptlerweb.appspot.com/script/show/486001

like image 28
Bananeweizen Avatar answered Oct 30 '25 13:10

Bananeweizen