9

I am just starting with jenkins. And I am trying to run a build on a branch/master.

And all I am getting is Did not schedule build for branch: master

Here is the log:

Started by timer
[Sun Mar 05 18:23:43 NPT 2017] Starting branch indexing...
Connecting to https://bitbucket.org using sameerkattel@hotmail.com/****** (sameer_kattel)
Repository type: Git
Looking up sameer_kattel/protected-consumer for branches
Checking branch single_page_app from sameer_kattel/protected-consumer
Checking branch master from sameer_kattel/protected-consumer
      ‘Jenkinsfile’ found
Met criteria
Changes detected: master (null → b2e24fc7a3a3c68f84dddf69d2cedc79f8478bf3)
Did not schedule build for branch: master
Checking branch enable_cors_response_lamda from sameer_kattel/protected-consumer
Looking up sameer_kattel/protected-consumer for pull requests
[Sun Mar 05 18:23:45 NPT 2017] Finished branch indexing. Indexing took 2.1 sec
Finished: SUCCESS

How do I schedule a branch?? Here is my JenkinsFile

#!groovy

node {

    currentBuild.result = "SUCCESS"

    try {

       stage 'Build'

            checkout scm
            dir(spa)
            sh 'npm install'
            sh 'ng build'
        }

    catch (err) {
        currentBuild.result = "FAILURE"
         echo 'failed' 
        throw err
    }
}

Can some one point me to right direction??

StephenKing
  • 36,187
  • 11
  • 83
  • 112
Sameer
  • 3,124
  • 5
  • 30
  • 57
  • 1
    Did you find a solution to this??? – NicolasMoise Feb 27 '18 at 22:12
  • 1
    I know that this question is old, but I have this issue nowadays. Did you resolved this somehow? – Paweł Madej Apr 07 '19 at 14:35
  • Just had this issue and it seems to have mysteriously solved itself after I went into the config and hit 'verify' for the credentials. I didn't even save the (lack of) config changes. I've had a lot of these types of issues with Jenkins. – LinuxDisciple Sep 30 '21 at 23:35

2 Answers2

3

A suggestion found in some old IRC logs is that the "Automatic branch project triggering" option has been set to something that doesn't match the branch you want built. Set that option appropriately so that your desired branch or branches will build automatically.

oeuftete
  • 2,628
  • 1
  • 24
  • 33
1

As oueftete's answer suggests, make sure the "Automatic branch project triggering" regex matches your branch.

What I didn't realize (after coming back to this page and rereading that answer multiple times over the last year and a half) is that, unlike in python, a blank regex does NOT match everything. If you want to build every branch, you have to put .* in that field.

Heshy
  • 382
  • 1
  • 10