Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Triggering build with BitBucket webhook #4226

mmanzin ·

Hi,

I am trying to set up a BitBucket webhook, so that I can automatically trigger a build with every new commit.
I am running QuickBuild 10.0.5 and I am following the documentation here: https://wiki.pmease.com/display/QB10/Working+with+Bitbucket+Server

When I insert the QuickBuild URL on the bitbucket side, I get a 500 error. I believe this is caused by the fact that I did not include any authentication credentials with this rest URL. If I try accessing the same path on my terminal, I can only do it by providing my QuickBuild username and password.

How should I configure the webhook?

Thank you.

  • replies 4
  • views 2676
  • stars 0
steveluo ADMIN ·

Hi@mmanzin

To support BitBucket webhook, you need:

  1. add anonymous group at QuickBuild side
  2. add BitBucket webhook settings in the configuration setting at QuickBuild side
  3. add a webhook at BitBucket side

NOTE: make sure the webhook secret are identical in QuickBuild and BitBucket.

The webhook URL in BitBucket is in following format:

http://{quickbuild.host}/rest/webhook/bitbucket/{configurationId}

Replace the param quickbuild.host and configurationId with your actual value, below is an example I use for testing:

http://demo.pmease.com/rest/webhook/bitbucket/12?target=Android&mode=debug

You don't need any authentication credentials with the URL as we are using the secret defined in webhook settings, but do remember add anonymous group with REST access permission (by default) in QuickBuild.

mmanzin ·

Hi@steveluo

Thank you for your reply. I had not given REST access to the anonymous group.

Now that everything seems to be set up according to your directions, I am getting a different error: 403, "Invalid signature or secret". I have set up the same secret on both BitBucket and QuickBuild, and I believe it is a valid string. Do you have any idea of what might be causing this problem?

Thank you.

steveluo ADMIN ·

Hi@mmanzin

Normally, this is caused by incorrect encoding of the system. Do you use Windows? Please try add below line to file wrapper.conf which can be located at directory: $quickbuild_installation_dir/conf/

wrapper.java.additional.3=-Dfile.encoding=UTF-8

Please change the number (here is 3) if you have already used this number (3) before.

mmanzin ·

Hi@steveluo

Thank you for your help, this has been resolved. There seems to be a bug in the "test connection" button when setting up a webhook in BitBucket. If I test the connection from BitBucket, I get a 403 error. However, if I trigger the webhook by doing a commit, then everything works and the build is triggered.

For reference, I am using a Linux machine.

Thank you.