Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Wiki Markup


Enables Gitlab web hooks to be used to trigger SMC polling on Gitlab projects

Table of Contents
excludePlugin Information


For Gitlab there is an existing solution that might work for you.
You can just use the notifyCommit hook on Git plugin like this:

Code Block
http://yourserver/your-jenkins-server/git/notifyCommit?url=<URL of the Git repository for the Gitlab project>


That is where this plugin comes in.
It gives you the option to use build_now or  or notify_commit hook hook, whichever suits your needs better.

Build now hook

Add this web hook on your Gitlab project:

Code Block

Plugin will parse the Gitlab payload and extract the branch for which the commit is being pushed and changes made.
It will then scan all Git projects in Jenkins and start the build for those that:

  • match url of the Gitlab repo
  • match committed Gitlab branch


  • for branch comparison, it will take into account both the branch definition and the strategy (this is different from the original notifyCommit)
  • the project must be enabled
  • you don't have to setup polling for the project

Notify commit hook

Add this web hook on your Gitlab project:

Code Block

The procedure is the same as for the build now hook, the difference is that this hook schedules polling of the project, much like the original notifyCommit.

Additional notes:

  • the project must be configured not to skip notifyCommit

Hook data related

Gitlab uses JSON POST to send the information to the defined hook.
The plugin expects the request to have the appropriate structure, like this example:

Code Block

        :before => "95790bf891e76fee5e1747ab589903a6a1f80f22",
         :after => "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
           :ref => "refs/heads/master",
       :user_id => 4,
     :user_name => "John Smith",
    :repository => {
               :name => "Diaspora",
                :url => "localhost/diaspora",
        :description => "",
           :homepage => "localhost/diaspora",
            :private => true
       :commits => [
        [0] {
                   :id => "450d0de7532f8b663b9c5cce183b...",
              :message => "Update Catalan translation to e38cb41.",
            :timestamp => "2011-12-12T14:27:31+02:00",
                  :url => "http://localhost/diaspora/commits/450d0de7532f...",
               :author => {
                 :name => "Jordi Mallach",
                :email => ""


        [3] {
                   :id => "da1560886d4f094c3e6c9ef40349...",
              :message => "fixed readme",
            :timestamp => "2012-01-03T23:36:29+02:00",
                  :url => "http://localhost/diaspora/commits/da1560886d...",
               :author => {
                 :name => "gitlab dev user",
                :email => "gitlabdev@dv6700.(none)"
   total_commits_count => 3


Version history

Open issues

Jira Issues

Version 1.4.2 (Apr 2016)

  • Full support recent GitLab 8.x releases
  • Support for GitLab 8.1 commit statuses
  • JENKINS-33836, remove merge request projects even when merged branches triggering is disabled
  • JENKINS-33252, skip reporting if gitlab url/token not configured
  • JENKINS-29317, implemented endpoint for triggering a specific jenkins project
  • JENKINS-30322, report on job log about communications through gitlab API
  • JENKINS-28808, fixed Multiple SCMs projects
  • Avoid tag building projects to be elected as candidates to automatically create projects
  • Improved acceptance tests & documentation

Version (Jan 2016)

  • JENKINS-28327, uncaptured exception on malformed congiguration file
  • JENKINS-28452, configurable triggering for projects with pre-build merges
  • Fixed parameter serialization for tag builds

Version 1.4.0 (May 2015)

Version 1.3.1 (Feb 27 2015)

  • JENKINS-27101, exception happens when creating a project from a template
  • Issue #56, elevated privileges required for automatic project creation

Version 1.3.0 (Feb 19 2015)

  • Template based automatic project creation
  • Improved branch matching. Mainly allow exact matches for */master and allow branch specifications starting with refs/

Version 1.2.1 (Feb 3 2015)

  • Issue #3 allowing also choice parameter type for branch name parameter

Version 1.2.0 (Jan 19 2015)

  • Issue #44 global configuration for automatic project per branch creation
  • Issue #50 trigger the build only for multi configuration project, not it's axis
  • Issue #31 payload data is auto-filled to job parameters
  • Issue #41 supporting refspec matching (if refspec present in job configuration)
  • Issue #39 multiple smc's support
  • Issue #42 git 2 support
  • Issue #43 better error handling, exceptions converted to java RuntimeException
  • #JENKINS-24232 fix for branch specifier that is not of String type, now just skipping such projects instead of raising exception
  • Issue #45 fix for getting branch name from payload, did not work correctly for tags
  • fix for invalid or empty payload, returns the actual payload sent and a more meaningful description
  • catching invalid route, displaying known routes and link to wiki
  • improved logging for request details, payload, matching projects
  • displaying stack trace on exception, nicely formatted for api response or in log

Version 1.1.0 (Jul 13 2014)

  • Issue #30 supporting crumb exclusion
  • Issue #26 automatic detection and filling of parameters from payload
  • RSpec 3.0 compliance