How do I pass the commit SHA as a parameter in GITLab WebHook

让人想犯罪 __ 提交于 2019-12-11 01:37:11

问题


I want to trigger a Jenkins Job if there is code commit made to Gitlab

I am using WebHooks for this:

The URL I am trying is

http://10.192.39.32:1024/job/SCMSnaps/buildWithParameters?token=secretkey&SNAP=$GIT_COMMIT

I want SNAP to hold the value of the SHA Number on the Gitlab

can anyone help with the correct way to pass variables in a WebHook URL?


回答1:


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



来源:https://stackoverflow.com/questions/42271430/how-do-i-pass-the-commit-sha-as-a-parameter-in-gitlab-webhook

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!