简体   繁体   中英

Jenkins: Access bitbucket payload in shell

According to the documentation of the bitbucket plugin for Jenkins ( https://wiki.jenkins-ci.org/display/JENKINS/BitBucket+Plugin ) it should be possible to access the payload infos through the environment varaible $BITBUCKET_PAYLOAD. However when in my build I run the command printenv, there is no environment variable called $BITBUCKET_PAYLOAD, and nothing related to it. So it's impossible for me to access informations I need to configure my build.

You can trigger Jenkins with Generic Webhook Trigger instead.

Then you can create a variable everything having the JSONPath $ . Then everything will resolve to the entire JSON payload. So you can have a shell script build step like:

echo $everything

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