Proper configuring of Multibranch Pipeline in Jenkins

怎甘沉沦 提交于 2019-12-10 12:45:03

问题


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.


回答1:


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.




回答2:


Also make sure your Jenkinsfile does not have a .groovy extension




回答3:


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

Jenkinsfile



回答4:


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




回答5:


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.




回答6:


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




回答7:


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.



来源:https://stackoverflow.com/questions/38344936/proper-configuring-of-multibranch-pipeline-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!