Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are "Branch indexing" activities in Jenkins BlueOcean

I'm setting a Multi-Branch pipeline in jenkins blue ocean. Everything is starting to work nice.

One thing I've noticed is that once a while, I get an execution of the job named: "Branch indexing" running.

My build contains some heavy unit testing and code coverage, that take ~4h30 to be executed, so having this job randomly executed 2 times is not really good(not even taking in account that we have 6-8 active branches, so it would mean that the executions will only stacks.

So:

1) What are those executions? 2) Is this absolutely required? 3) Can I disable it?

like image 345
J4N Avatar asked Nov 08 '22 05:11

J4N


1 Answers

In Jenkins, we can create a stage to abort branch indexing.

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..."
                }
            }
        }
like image 63
Optimus Avatar answered Nov 15 '22 13:11

Optimus