There's a vast variety of ways for connecting Jenkins jobs to other jobs (e.g., triggering, copying artifacts, promotion criteria etc). Is there a way to (reliably) determine which Jenkins jobs refer to a given job X? (Or, conversely: which jobs are referenced by a given job X?)
I tried heuristics like grepping all config.xml
files for job name X
, but this is not reliable of course. E.g., that catches job names in text/comment sections, and it will miss references that are not stored in the job config.xml
files (like settings for the promoted-builds plugin).
I'm not interested in checking for specific kinds of references (this is simple once you know the corresponding XML format or the internal connection on object level). I wonder if there's a way to check for any kind of reference between jobs in a generic way.
As background, there's several use cases where you may want to determine which jobs are "connected" in some way, e.g.:
- Cleaning up your job inventory: you want to delete obsolete jobs, but before deleting, you want to be sure that no other job still depends on it.
- Packaging a collection of jobs (including all its dependencies) for a customer
- Updating references to some job X that has been replaced or moved to some different folder.