问题描述
我有一个使用多分支项目.也就是说,在向存储库创建新分支时,Jenkins会自动为该分支自动创建一个新作业,并在删除该分支时删除该作业.
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?
推荐答案
我认为并非没有编写插件代码.如果您有兴趣,相关的扩展点将是cloudbees-folder
插件中的OrphanedItemStrategy
.
Not without writing plugin code I think. If you are interested, the relevant extension point would be OrphanedItemStrategy
from the cloudbees-folder
plugin.
这篇关于在Jenkins的多分支管道中删除分支时执行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!