BitBucket Jenkins doesn't automatically build

后端 未结 14 946
予麋鹿
予麋鹿 2020-12-30 21:44

On my Jenkins I configured:

Source Code Management

Git repository: https://bitbucket.org/username/project.git

credentials: username/

相关标签:
14条回答
  • 2020-12-30 22:04

    You must pay attention to the Branch specifier field and specify the branch that you are pushing to.

    Jenkins plugin for Bitbucket will not start a job if no changes are detected. you can add more than one branch to be watched.

    as mentioned by the official documentation only If the job's SCM (git) detects that the remote repository has changes THEN it will invoke the build.

    So if you leave the branch specifier with its default value */master and you are pushing to a different branch then the job will not be executed.

    0 讨论(0)
  • 2020-12-30 22:05

    I also had this issue and resolved by updating the bitbucket plugin in jenkins:

    Also ensure that webhook url is in the correct format and has the '/' at the end:

    {JenkinsURL}/bitbucket-hook/

    0 讨论(0)
  • 2020-12-30 22:10

    Did you mark the checkbox where it says: Poll SCM? Also make sure that you schedule a short time to detect the changes in the repository as soon as possible.

    Maybe your problem is that you schedule for a long time and after your push Jenkins wait some time to detect the changes.

    0 讨论(0)
  • 2020-12-30 22:13

    You don't need to enable Polling SCM..

    You have to ensure that your Webhook (Settings->Webhooks) is pointing to your Jenkins bitbucket-hook like the following: "https://ci.yourorg.com/bitbucket-hook/".

    Notice that last "/", without it, the build will not be triggered.

    It's an annoying thing, as you will get a 200 status code from Jenkins when sending requests, with or without it.

    0 讨论(0)
  • 2020-12-30 22:14

    I was struggling with this issue for long, and couldn't find a solution in Jenkins documentation, I found here a solution in Cloudbees support site.

    You just need to add these tow webhooks to your bitbucket repo :

    https://JENKIN_URL/bitbucket-scmsource-hook/notify
    https://JENKIN_URL/bitbucket-hook
    

    And i work for all pipelines even MultiBranch ones.

    Hope this helps someone ;)

    ADA

    0 讨论(0)
  • 2020-12-30 22:16

    In my case, this was solved by setting the Branch Options (Advanced Configuration) of the Bitbucket to Jenkins Webhook to "Build All".

    0 讨论(0)
提交回复
热议问题