Jenkins Blue Ocean多分支流水线排除develop分支不生效怎么办?
我在用Blue Ocean创建多分支流水线时想排除develop分支,按文档在Pipeline Script里写了excludeBranches: ['develop'],但运行时提示hudson.plugins.git.GitException: Failed to connect to repository,develop分支还是被扫描到了。我试过在Jenkinsfile加ignore-on-push参数也不行,谁能教我正确的排除方法?
我的配置大概是这样的:
pipeline {
agent any
triggers { pollSCM 'H/5 * * * *' }
options {
skipDefaultCheckout true
disableConcurrentBuilds()
}
stages {
stage('Build') { ... }
}
}
检查过分支名称确认没错,但就是不生效,是不是排除语法有问题?或者需要在其他配置页面设置?
!develop。如果你非要在Jenkinsfile里处理,可以试试这样写:
建议还是用第一种方法,更直观靠谱。
Branch Indexing的时候会读这个配置,写在pipeline里面就无效了。