如何在GITLab WebHook中将提交SHA作为参数传递 [英] How do I pass the commit SHA as a parameter in GITLab WebHook
本文介绍了如何在GITLab WebHook中将提交SHA作为参数传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果对Gitlab进行了代码提交,我想触发Jenkins工作
I want to trigger a Jenkins Job if there is code commit made to Gitlab
我为此使用WebHooks:
I am using WebHooks for this:
我正在尝试的网址是
http://10.192.39.32:1024/job/SCMSnaps/buildWithParameters?token=secretkey&SNAP=$GIT_COMMIT
我希望SNAP在Gitlab上保留SHA编号的值
I want SNAP to hold the value of the SHA Number on the Gitlab
任何人都可以帮助以正确的方式在WebHook URL中传递变量吗?
can anyone help with the correct way to pass variables in a WebHook URL?
推荐答案
您应该为jenkins安装gitlab hook插件,它可以让您做自己想做的事情:
https://wiki.jenkins-ci.org/display/JENKINS/Gitlab + Hook +插件
You should install the gitlab hook plugin for jenkins, it will allow you to do just what you want :
https://wiki.jenkins-ci.org/display/JENKINS/Gitlab+Hook+Plugin
这篇关于如何在GITLab WebHook中将提交SHA作为参数传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文