什么是 Jenkins BlueOcean 中的“分支索引”活动

J4N*_*J4N 5 jenkins jenkins-pipeline jenkins-blueocean

我正在詹金斯蓝海中设置多分支管道。一切都开始运转良好。

我注意到的一件事是,有一段时间,我会执行名为“Branch indexing”的作业。

我的构建包含一些繁重的单元测试和代码覆盖率,需要大约 4 小时 30 分才能执行,因此将这项工作随机执行 2 次并不是很好(甚至没有考虑到我们有 6-8 个活动分支,所以这意味着处决只会堆叠。

所以:

1) 那些处决是什么?2)这是绝对必要的吗?3)我可以禁用它吗?

小智 2

在 Jenkins 中,我们可以创建一个阶段来中止分支索引。

stage('Branch indexing: abort') {
            when {
                allOf {
                    triggeredBy cause: "BranchIndexingCause"
                    not { 
                        changeRequest() 
                    }
                }
            }
            steps {
                script {
                    echo "Branch discovered by branch indexing"
                    currentBuild.result = 'SUCCESS' 
                    error "Caught branch indexing..."
                }
            }
        }
Run Code Online (Sandbox Code Playgroud)

  • 您正在解释“分支索引”是什么吗? (2认同)