Retrieving email data from a web hook in jenkins

I am using gitlab and I want to trigger the system hook whenever a project is created. I added a hook with the following jenkins api call (I use the jenkins plugin, so the api looks different).

http://myip:8081/buildByToken/buildWithParameters?job=testHook&token=hook

this starts jenkins work, but I can not get the messages sent by the hook in my jenkins work.

Below is an example of what gitlab sends as mail data with this hook.

{
          "created_at": "2012-07-21T07:30:54Z",
          "event_name": "project_create",
                "name": "StoreCloud",
         "owner_email": "johnsmith@gmail.com",
          "owner_name": "John Smith",
                "path": "stormcloud",
          "path_with_namespace": "jsmith/stormcloud",
          "project_id": 74,
           "project_visibility": "private",
}

Is there a way to get message data in jenkins that are sent using webook?

+2
source share
1 answer

There is a specific plugin for integrating Jenkins and Gitlab.

https://github.com/elvanja/jenkins-gitlab-hook-plugin#build-now-hook

http://your-jenkins-server.com/gitlab/build_now, , . , , , . env, ${USER_NAME}

, /gitlab/notify _commit, , - ( ).

, /buildByToken/buildWithParameters, build_now like, . GitLabHookPlugin, .

Marco

0

All Articles