It's all about the answers!

Ask a question

RTC Gitlab integration - only by node.js hooks or also by webhooks


Christian Naujoks (1112) | asked Apr 11 '17, 11:06 a.m.

Hi all,

in our project we would like to link git pushes with RTC workitems.
So we went through the documentation in here:
https://www.ibm.com/support/knowledgecenter/en/SSYMRC_6.0.2/com.ibm.team.connector.cq.doc/topics/t_git_lab_integ.html

Now a colleague of mine has a different understanding from the documentation
I think we need to hook in the node.js scripts into our Gitlab server, while he considers that it should work via Gitlabs WebHooks and that the RTC server would interpret everything from the push commit.
So my main question is:
Is it required on Gitlab CE edition to use the hook scripts provided by IBM via download?
 
I had to admit that reading the GitHub integration documentation that there might be also a solution that works without scripts on the git server side and just by a webhook using the  com.ibm.team.git.common.internal.IGitHubInvokeService on the Payload URL.


One answer



permanent link
Karthik N V S (563) | answered Apr 12 '17, 6:06 a.m.
JAZZ DEVELOPER

 Hi,

The integration using Gitlab webhooks is not supported. So you need to use the hook scripts.


Comments
Christian Naujoks commented May 03 '17, 3:30 a.m.

Hi, thanx for your fast answer.
My colleague has an additional question towards it but on posting he gets an error message. So I am posting on behalf:

“Thanks for the response. Requesting some more clarification  the git integration package offered by IBM. It offers a sample hook and a  node.js scripts to use for a plain GIT scenario. Which of the package contents are applicable for the GITLAB scenario?


Karthik N V S commented May 03 '17, 7:48 a.m.
JAZZ DEVELOPER

 Hi,

I am not sure which version you are using. In the toolkit you will have a folder 'gitlab' under 'server\hooks\examples'. The pre-receive and post-receive files under this directory needs to be configured and  copied into custom_hooks directory (refer this link https://docs.gitlab.com/ee/administration/custom_hooks.html). 


Christian Naujoks commented May 08 '17, 10:29 a.m. | edited May 08 '17, 10:32 a.m.

Hi Karthik,
we do use the Git Server toolkit 6.0.2 and on gitlab we do use the Gitlab Community Edition 8.13.3.
The toolkit zip contains a lot more in folder 'server' e.g. Utils.
So what all do we need? Clear the pre-receive and post-receive files from examples.
But these will call UpdateWorkItemCommitLinks.js - correct?
And this will use some more?


Karthik N V S commented May 09 '17, 7:06 a.m.
JAZZ DEVELOPER
1. Create a custom_hooks directory under your project's repository directory. As mentioned in the following link https://docs.gitlab.com/ee/administration/custom_hooks.html, the path is usually /home/git/repositories/<group>/<project>.git

2.Copy the pre-receive and post-receive hook files from toolkit (<toolkit>\server\hooks\examples\gitlab) to custom_hooks directory of your Gitlab repository and provide executable permissions.

3. Configure hooks by providing  GitLab server URL, GL_TOKEN, RTC_GIT_SERVER_TOOLKIT_PATH details in the  pre-receive and post-receive hook files.
4. Restart the Gitlab server.


Christian Naujoks commented May 09 '17, 7:18 a.m.

Related to point 3:
RTC_GIT_SERVER_TOOLKIT_PATH.
This is the location on the git server where it is expected that the entire toolkit zip is extracted?
We wanted to know which parts we need? Or do we need everything?


Karthik N V S commented May 09 '17, 9:40 a.m.
JAZZ DEVELOPER

 Yes, you need to point it to the location where you extracted the zip.

The hooks.py directory is not required if you are using nodejs based hooks. But, I would suggest not deleting any directory in toolkit. 
In addition to the above steps, you need to configure the git config rtc.repokey and rtc.repurl by running the following commands from your projects remote directory
git config rtc.repourl <your RTC server url>
git config rtc.repokey <your repositories repo key>
The repokey is generated after registering your Gitlab repository with RTC.

showing 5 of 6 show 1 more comments

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.