Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would a job in Jenkins multibranch pipeline gets disabled

We are using Jenkins(v2.235.1) and BitBucket cloud combination. We have BitBucket Team/Project type job which has created multi-branch pipelines. Some of the jobs corresponding to individual branches are getting disabled even these branches in the Git repo are active. Not sure why this is happening.

Can you please share some insight on this and how we can prevent this from happening.

Below are my versions

  • Jenkins v2.235.1
  • Bitbucket Branch Source plugin v2.9.7
  • Bitbucket plugin v1.1.27

Thank you

like image 830
Bhavya Avatar asked Apr 02 '21 16:04

Bhavya


2 Answers

If there is no Jenkinsfile at the root of the repository or if the name is misspelled or is with different letters casing, like JenkinsFile, the job will be disabled.

From https://www.jenkins.io/doc/book/pipeline-as-code/

Presence of the Jenkinsfile in the root of a repository makes it eligible for Jenkins to automatically manage and execute jobs based on repository branches.

like image 199
K. B. Avatar answered Oct 13 '22 12:10

K. B.


Make sure you have only one jenkinsfile in your root directory. it is not a good idea to have more than one file with the name jenkinsfile which causes jenkins to disable the job. this could be one the reason why your job is getting disabled.

like image 24
Rakesh B E Avatar answered Oct 13 '22 10:10

Rakesh B E