0

Software Versions: github-plugin version 1.29.3
Jenkins ver. 2.163 nginx reverse proxy

Current State No communication issues, and build triggers from the push event. However no values in $payload

GitHub Configuration:

Github Webhook: on repo https://username:password@publicIP:port/github-webhook/

Content type (tested both application/x-www-form-url-urlencoded & application/json)

Event type: Just the push Event

..

Jenkins Configuration:

GitHub Project: Populated with the project URL

This project is parameterized: String parameter payload

Source Code Management: REPO URL & Creds Branch Master

Build Triggers: GitHub webhook trigger for GITScm polling

Build Execute Shell:


echo "the build worked! The payload is $payload"

Output: is blank for the $payload the build worked! The payload is

winn j
  • 442
  • 3
  • 17

2 Answers2

1

Decided to use the Generic Webhook Trigger Plugin https://wiki.jenkins.io/display/JENKINS/Generic+Webhook+Trigger+Plugin

winn j
  • 442
  • 3
  • 17
-1

A simple quick and dirty way to parse "name" and "email" is the below, treating the JSON file as raw text (which has it's own caveats of course)

name=$(grep pusher -A5 <your_json_file> | grep  name | cut -d':' -f2 | cut -d' ' -f2 | tr -d \" | tr -d ,)
email=$(grep pusher -A5 <your_json_file> | grep email | cut -d':' -f2 | cut -d' ' -f2 | tr -d \" | tr -d ,)
nullPointer
  • 4,419
  • 1
  • 15
  • 27
  • So this implies that there is a Which if there was this would work. However, i can't even get at the payload to write it to a file – winn j Feb 06 '19 at 14:44