0

Bitbucket Multibranch Pipeline

We're trying to configure hooks on our Bitbucket repo while generating the multibranch pipelines so that we don't need to poll bitbucket to trigger builds.

We're using the Post webhooks plugin in bitbucket and have a script to configure this automatically, we'd just like to be able to do this as we're generating the pipelines.

5 comments

  • 0
    Avatar
    Manuel Cardenas

    Hi Domhnaill,

     

    Would it be possible for you to take a look at the document below and check if that covers your use case?

    https://support.cloudbees.com/hc/en-us/articles/115000053051-How-to-Trigger-Multibranch-Jobs-from-Bitbucket-Server- 

     

    Hope that this helps.

    Best regards,

    Manuel

     

     

  • 0
    Avatar
    Domhnaill Byrne

    Hi Manuel,

     

    This is the set up that we've configured but we'd like to automate the set up of the hook in the same step as we create the multi-branch pipelines.

    The workflow we want is;

    1. Cloudbees Bitbucket project scans the repository and finds markerfile

    2. creates the multibranch pipeline

    3. Configures the Webhook plugin for the repo to trigger the jobs in cloudbees. (We have a script to configure this but we'd like to run it automatically once a pipeline is created)

    Let me know if this is possible.

    Thanks,

    Domhnaill 

     

     

  • 0
    Avatar
    Manuel Cardenas

    Hi Domhnaill,

     

    Sorry, I missed your use case. I think that what you are expecting is something like: https://issues.jenkins-ci.org/browse/JENKINS-48035 am I correct?

    This way once that the job is created the webhook is already registered. Could you confirm that the webhook is created when you go to "Manage Jenkins > Configure System > GitHub plugin > Advanced > Re-register hooks for all jobs" ?

     

    According to the Jira issue the problem is solved in newer versions of the plugin. Could you verify that?

    Cheers,

    Manuel

  • 0
    Avatar
    Domhnaill Byrne

    That looks like it works, thanks!

    Is it possible to configure the settings when it creates the hook?

    We'd like it to work on only pull-requests so we need to set "Branches to ignore" to ".*" or to ingore

    In an unrelated question, the generated job in cloudbees - can the master branch job be renamed to "Build and Release"? We'd like it to be more descriptive for the devs. 

     

    Thanks,

    Domhnaill

  • 0
    Avatar
    Manuel Cardenas

    Hi Domhnaill,

    I am not sure that you can do it OOB, but I am pretty sure that you can craft a groovy script that can update the settings for the multibranch pipelines jobs with certain properties.

    Hope that this helps,

     

    Manuel

Please sign in to leave a comment.