简体   繁体   中英

Proper configuring of Multibranch Pipeline in Jenkins

How do I properly configure a Multibranch Pipeline in Jenkins when Git is selected as branch source? I get a "Does not meet criteria" for every branch that is checked in the branch indexing log.

This Multibranch Pipeline job will create a pipeline job if your Git branch contains a Jenkinsfile.

This Jenkinsfile describe how to build the current branch (Jenkins Groovy DSL).

If your branch doesn't contain a Jenkinsfile, then you will get this "does not meet criteria" message.

More information about the Multibranch pipeline here .

另外,请确保您的Jenkinsfile 具有.groovy扩展

At least on Windows the casing of the Jenkinsfile is important. It has to be with an uppercase "J" and the rest lowercase.

Jenkinsfile

It appears to check the script type. The first line of "Jenkinsfile" had to be: "#!groovy"

As Bruno Lavit points out the criteria is pretty simple.

I believe you may have an issue with your current branch.

In a clean environment, try to checkout the branch and verify that the Jenkinsfile is indeed included and that is it a valid text file. I had a similar issue in the past where my push did not finished correctly.

I think that your jenkins plugin (Git plugin and Git Client plugin) is old. Try to update the plugins.

I run into this when I added Jenkinsfile after I had created the Multibranch Pipeline project. The solution was to delete the project and create again :)

Still, for some Jenkins-only-know reason, it doesn't run the build on my master branch now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM