Access to the Jenkins BitBucket Web Hosting Payload

I use webhooks on Bitbucket to run the build on Jenkins when the push event occurs, for this I use the Bitbucket plugin. My Jenkins pipeline consists of several cross-dependent tasks, for example:

Main pipeline (running task)

  1. 1) build docker images
  1. 2) run tests
  1. 3) do something

The build starts when it is expected, but the tasks fail because they rely on the specific branch that I need to provide. Unfortunately, I do not know how to access the webhook payload, which has all the information I need.

An alternative would be to use the Poll CMS option in Jenkins, but I prefer to build on demand rather than periodically.

+6
source share
1 answer

From:

https://wiki.jenkins-ci.org/display/JENKINS/BitBucket+Plugin

they speak:

Since 1.1.5 Bitbucket automatically introduces the payload received by Bitbucket into the assembly. You can catch the payload to handle it through the $ BITBUCKET_PAYLOAD environment variable.

Hello

0
source

All Articles