Clicking on GitLab repository does not start Jenkins build

gitlab plugin Version: 1.4.2

jenkins Version: 2.7.4

gitlab Version: GitLab Community Edition 8.11.4

I followed the plugin documentation and set up webhook accordingly

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

  • Added gitlab repo to jenkins work, connection test completed successfully. Creation of the jenkins job was completed successfully (the code is extracted from the repo correctly, so there are no problems)

  • Added webhook for jenkins. Webhook testing also succeeds (returns HTTP200). But on the side of the Jenkins. nothing happens as the test result even after it was run after changing the repo (jenkins log and gitlab show no activity)

  • When I try to check the whole setup. I am doing a new push to the gitlab repo to find out if it is invoking a new build on jenkins. But nothing happens. Can anyone help me with this? I am not sure what is wrong here, like a test hook and a test connection gitlab show success.

Thank you in advance.

By the look

+5
source share
2 answers

In Jenkins, you install and configure (global and task) the Gitlab Hook plugin

in your webhook you can do 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 run a specific job URL: http: // your-jenkins-server / gitlab / build_now / job_name

job_name is the name of the job created in jenkins

+4
source

I followed the instructions here and everything worked quite well: https://github.com/jenkinsci/gitlab-plugin/wiki/Setup-Example . You can return jenkins results to GitLab pipelines.

You can also drop results using jenkins pipeline:

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

Source: https://habr.com/ru/post/1257691/


All Articles