Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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.


0 votes



One answer

Permanent link

 Hi,

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

0 votes

Comments

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?

 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). 

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?

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.

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?

 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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 457
× 97
× 7
× 4

Question asked: Apr 11 '17, 11:06 a.m.

Question was seen: 3,121 times

Last updated: May 09 '17, 9:40 a.m.

Confirmation Cancel Confirm