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

4

2 回答 2

1

决定使用通用 Webhook 触发器插件https://wiki.jenkins.io/display/JENKINS/Generic+Webhook+Trigger+Plugin

于 2019-02-08T19:46:03.047 回答
-1

下面是解析“name”和“email”的一种简单快速而肮脏的方法,将 JSON 文件视为原始文本(当然有它自己的警告)

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 ,)
于 2019-02-06T08:27:08.757 回答