问题
I have a Jenkins that uses multi branch project. That is, when a new branch is created to repository, Jenkins automatically will automatically create a new job for the branch, and remove that job when the branch is removed.
Now, I'd like to run some code when the branch is removed, to clear testing environments that were created when the branch was created. It there a way to do this?
回答1:
Not without writing plugin code I think. If you are interested, the relevant extension point would be OrphanedItemStrategy
from the cloudbees-folder
plugin.
来源:https://stackoverflow.com/questions/37701289/executing-code-when-a-branch-is-removed-in-jenkins-multi-branch-pipeline