Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkinsfile not found Does not meet criteria

Tags:

jenkins

I have created a Jenkins (Jenkins ver. 2.60.1) multi branch pipeline job with Git SCM. In the root of the repository on master branch I have a valid Jenkinsfile but when I scan the job I get:

  Checking branch master
      ‘Jenkinsfile’ not found
    Does not meet criteria

Job config:

enter image description here

Any ideas?

like image 255
u123 Avatar asked Jan 19 '18 14:01

u123


1 Answers

You might look at this Jenkins issue and see if it helps. Jenkinsfile not found in PR on GitHub

We were having a similar problem and the workaround listed in that issue at least got us past the problem. In our case the problem stems from using Github's "Allow rebase merging" option when merging pull requests, and then continuing to add commits into that same branch. Then on the next PR we would see this problem.

The workaround is to delete the contents of: $jenkins_home/org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache

and then have Jenkins rescan the repository.

Another option is to create a clean branch, cherry-pick the commits from the branch that Jenkins claims has no Jenkinfile, and then create another PR from your new branch.

like image 70
Tom Avatar answered Oct 25 '22 16:10

Tom