问题
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