如何使用Github Webhook在Jenkins中触发管道
我想用Github webhook触发一个管道。此管道与我的Github存储库和Github webhook连接 我想用webhook中的ID_commit、Github分支等信息触发这个管道 例如:如何使用Github Webhook在Jenkins中触发管道,jenkins,triggers,jenkins-plugins,jenkins-pipeline,webhooks,Jenkins,Triggers,Jenkins Plugins,Jenkins Pipeline,Webhooks,我想用Github webhook触发一个管道。此管道与我的Github存储库和Github webhook连接 我想用webhook中的ID_commit、Github分支等信息触发这个管道 例如:if BRANCH==master:buildpipeline 我尝试使用2个插件,但不起作用: 推送时从GitHub发送的webhook如下所示: 要将分支(ref)放入变量中,需要配置JSONPath参数。像maby变量ref和表达式$.ref 要仅在分支为master时触发,您需要配置
if BRANCH==master:buildpipeline
我尝试使用2个插件,但不起作用:
ref
和表达式$.ref
要仅在分支为master
时触发,您需要配置一个过滤器。在可选筛选器中,将regexp指定为master
,将文本指定为$ref
另外,正如wiki所建议的,用
curl
解决这个问题可能是最容易的。我应该创建一个Bash脚本吗?或者我错过了什么?
...
{
"ref": "refs/heads/changes",
"before": "9049f1265b7d61be4a8904a9a27120d2064dab3b",
"after": "0d1a26e67d8f5eaf1f6ba5c57fc3c7d91ac0fd1c",
"created": false,
...