Reputation: 31540
If a branch is deleted or the jenkinsfile is removed jenkins will remove the job.
Is there a feature to expire and black list old multibranch jobs? So I could expire multibranch jobs that havent run in a month and jenkins would delete those jobs and ignore those branches (even if a jenkinsfile was in them).
It would of course need to keep a list of expired branches somewhere and have a way to un-expire them. Is there a plugin for this?
Upvotes: 3
Views: 482
Reputation: 4319
The Aged References SCM filter plugin is available for GitHub and other SCM: e.g. https://plugins.jenkins.io/github-scm-filter-aged-refs for GitHub
It might work for you: it adds a branch detection criteria that exclude branches that haven't had updates over an arbitrary period of time. Your question suggests you're looking at jobs/branches that "haven't run" in a while, which would be the case if they haven't seen commits. But this plugin sort of ignores jobs that were triggered manually, I think.
With this plugin, you 'un-expire' a branch job by adding a new commit to it, essentially.
Upvotes: 2