0
votes

I am using Gitlab community edition and I created a web-hook to my project which is trigger in push events. This web-hook successfully trigger the Jenkins job but I need some additional information for my jenkins job like branch name and etc. Jenkins version 1.640.

I tried to follow this instruction: https://github.com/jenkinsci/gitlab-hook-plugin.

I write this code to the job echo ${FULL_BRANCH_REFERENCE} but there is nothing in it.

I used this url in the web-hook: http://x.x.x.x:8080/job/gitlab/build (build_now did not work for me)

Br,

1

1 Answers

0
votes

I have found two solution. I followed this description: https://github.com/jenkinsci/gitlab-hook-plugin. First solution is using git-lab hook plug-in on Jenkins master.

  • Add Jenkins master URL on git-lab project web-hook.
  • And if we have a job that contains that git repo URL which are we added a web-hook. Git-Lab Web-hook plug-in will trigger all of those jobs.
  • And we can parameterize that jobs with some specific parameter (BRANCH, USERNAME, etc.) and now we can use these informations an a job.

Second solution could be Jenkins CI service which is not available on Git-Lab community edition.