简体   繁体   中英

Bitbucket Server Webhook to Jenkins: Error: Jenkins response: No git jobs using repository

I've installed Webhook to Jenkins for Bitbucket plugin in bitbucket server. The main goal is that a jenkins build will be triggered after a commit.

After the install I've enabled the plugin: jenkins-url: https://url/jenkins ssh: ssh@git.. (same command is used in SCM plugin jenkins job).

The jenkins job works (git clone etc works) but the plugin isn't working. When I click test on the jenkins webhook plugin it shows me:

Error: Jenkins response: No git jobs using repository: ssh://git@xx.git t and branches: master 

The URL is right. So it is used in my jenkins job (and branch master). I've even copied the url from the error as URL in the jenkins job and it is still able to clone the repo. What do I forget?

EDIT:

I found some info that you should enable SCM polling in your job (even if this is polling once in a year). Only than this plugin will work? Is this the normal behaviour? (it seems to fix my issue)

Yes, you have to check Poll_SCM in the Build Triggers section of your Jenkins Job configuration - I can confirm this. I'm doing the same thing you are and that's how I got it to work - you can find confirmation of such at the Atlassian site

For me the problem was that BitBucket was using all lower case git url but jenkins was internally using the url with parts in the original case and therefore it found not machting project. Adding an custom url fixed the issue for me

Enable the SCM polling, leave it blank and don't mention anything in schedular. This way SCM plugin is going to get response from bit bucket, and ignore the error if "No git jobs using repository"- if http status is 200, it should work properly..

Configure your project. Under Triggers, make sure that Poll SCM is checked.

You can enter a schedule if you want, but you don't have to . If no schedule is entered, it should display something like "No schedules so will only run due to SCM changes if triggered by a post-commit hook" .

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