JSON::ReadPath - In Jenkins grep payload json data and assign to an environment variable.
Let's say Bitbucket pushed a payload '{"commits":{ "branch": "FooBar" }}'
And we want to grab the branch name from the payload.
BRANCH=$(read_json.pl --env payload --path commits.branch)
To install JSON::ReadPath, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::ReadPath
CPAN shell
perl -MCPAN -e shell install JSON::ReadPath
For more information on module installation, please visit the detailed CPAN module installation guide.