Naveed Haider
Naveed Haider

Reputation: 105

Pushing to GitLab repo does not trigger the Jenkins build

gitlab plugin Version: 1.4.2

jenkins Version: 2.7.4

gitlab Version: GitLab Community Edition 8.11.4

I have followed the plugin documentation and setup the webhook accordingly

(https://github.com/jenkinsci/gitlab-plugin).

Thankyou in advance.

Naveed

Upvotes: 8

Views: 11634

Answers (2)

Inforedaster
Inforedaster

Reputation: 1330

In Jenkins you install and configure (global and job) Gitlab Hook Plugin

in your webhook can you make this :

URL : http://your-jenkins-server/gitlab/notify_commit or http://your-jenkins-server/gitlab/build_now.

Trigger : you check Push Events

and try again

To trigger a specific job the URL is: http://your-jenkins-server/gitlab/build_now/job_name

job_name is the name of the job created in jenkins

Upvotes: 4

Carlos Cavero
Carlos Cavero

Reputation: 3176

I followed the instructions here and everything worked quite well: https://github.com/jenkinsci/gitlab-plugin/wiki/Setup-Example. It is possible to give back the results of the jenkins job to GitLab pipelines.

You can also push back the results using the jenkins pipeline:

node {
  gitlabBuilds(builds: ['Build', 'Test', 'QA']) {
    stage('Build') {
      gitlabCommitStatus(name: 'Build') {
          sh "your execution"
      }
    }
    // The rest of the stages here...
  }
}

Upvotes: 1

Related Questions