Comments (19)
I can confirm that the plugin does not work with Jenkins 2.0 Pipeline.
Steps to reproduce:
- create git repo in GitLab with a Jenkinsfile
- configure the 'build_now' webhook triggered by push events in GitLab pointing it to Jenkins
- configure a new Pipeline job in Jenkins using above created repo
- push some change into GitLab
- check Jenkins logs
Expected behavior:
- webhook triggered by the push and Jenkins building the pipeline project with the new changes
Actual behavior:
- webhook triggered by the push and Jenkins stating in the logs that it could not find a matching project: "no project references the given repo url and commit branch"
To verify that the plugin works otherwise I also created a freestyle job in Jenkins using the same git repo and a dummy shell step just echoing some text.
Having both jobs (pipeline and freestyle) in Jenkins and pushing changes to the git repo (or clicking on the test hook link in GitLab) leads to the result that the freestyle project build kicks off, but the pipeline one doesn't.
In the logs I could see that Jenkins found only one matching project, the freestyle one.
I hope this helps to pinpoint the cause of this issue.
from gitlab-hook-plugin.
Unable to trigger Pipeline Project build on Jenkins 2.7, Pipeline Plugin 2.2, GitLab 7.7.
Jenkins log: No valid crumb was included in request for /github-webhook/. Returning 403.
Tried these URLs, but in vain:
- http://your-jenkins-server/gitlab/build_now
- http://your-jenkins-server/gitlab/build_now/project_name
Freestyle project builds fine though.
Note: Disabled Cross Site Forgery security on Jenkins to make it working. Unchecked Manage Jenkins > Configure Global Security > Prevent Cross Site Request Forgery exploits
on Jenkins.
from gitlab-hook-plugin.
I used this URL and it works: http://jenkins host:port/project/my job name
from gitlab-hook-plugin.
What are the repro steps and expected behavior?
from gitlab-hook-plugin.
I'm still having this issue:
Feb 24, 2017 7:54:47 PM com.dabsquared.gitlabjenkins.webhook.GitLabWebHook getDynamic
INFO: WebHook called with url: /jenkins/project/Pipeline
Feb 24, 2017 7:54:48 PM org.jruby.javasupport.JavaMethod invokeDirectWithExceptionHandling
INFO: gitlab web hook triggered for
- repo url: [email protected]:developers/ACME.git
- branch: pipeline
- with payload:
{
"before": "19ed3ef57b7a1b12dbf546649ae61b234d8959fc",
"after": "c9d3369b5387a9c83c810448ad2854c7d883be9c",
"ref": "refs/heads/pipeline",
"user_id": 3,
"user_name": "Andres Montalban",
"project_id": 5,
"repository": {
"name": "ACME",
"url": "[email protected]:developers/ACME.git",
"description": "ACME Core Repository",
"homepage": "https://git.ACME.com/developers/ACME"
},
"commits": [
{
"id": "c9d3369b5387a9c83c810448ad2854c7d883be9c",
"message": "Initial config of Jenkins pipeline",
"timestamp": "2017-02-24T19:54:40+00:00",
"url": "https://git.ACME.com/developers/ACME/commit/c9d3369b5387a9c83c810448ad2854c7d883be9c",
"author": {
"name": "Andres Montalban",
"email": "[email protected]"
}
}
],
"total_commits_count": 1
}
Feb 24, 2017 7:54:48 PM org.jruby.javasupport.JavaMethod invokeDirectWithExceptionHandling
INFO: matching projects:
- Checkout_ACME_Repo
Feb 24, 2017 7:54:48 PM org.jruby.javasupport.JavaMethod invokeDirectWithExceptionHandling
WARNING: no project references the given repo url and commit branch
I have two jobs Checkout_ACME_Repo
(FreeStyle) and Pipeline
(Pipeline), but only former is matching.
from gitlab-hook-plugin.
@singh-abhijeet is this hook working with pipelines if you disable Cross Site Forgery security as you said?
from gitlab-hook-plugin.
@vkotovv Yes Vadim, the 403 error was due to Cross Site (Domain) request to the Web Hook. Disabling the security option helped. This solution is advisable if you're running Jenkins, Git within your org's Firewall; as disabling it can invite False/Forgery request to the Web Hook if your Jenkins instance is exposed publicly via Internet.
from gitlab-hook-plugin.
I'm having the same problem originally reported.. the web hook works fine on a freestyle project but does not work in pipeline project.. Has anyone found a workaround for this?
from gitlab-hook-plugin.
It is still not working with Pipeline-Projekts.
from gitlab-hook-plugin.
@bmaehr thanks, I had build successfully, it's docker image's problem, your PR work well in my machine,support 2.0 pipeline web hook
and system hook
. @javiplx , can you merge this PR to master
branch?
from gitlab-hook-plugin.
Is this issue fixed with the previous PR ?
from gitlab-hook-plugin.
My commit should fix it, but I also don't understand @colinlabs comment.
from gitlab-hook-plugin.
@bmaehr it works, but there is a problem, must success run a job before trigger hook
from gitlab-hook-plugin.
@colinlabs You mean: a job must run successfully to make the web hook work ?
from gitlab-hook-plugin.
@ikus060 yes, otherwise, it will raise an "Template not find" error
from gitlab-hook-plugin.
I think it is enough that the template has run once.
from gitlab-hook-plugin.
he, any update on this? looks like the PR was never merged.... for me it is not working even when the pipeline ran once
from gitlab-hook-plugin.
It looks like I didn't notice the notification about #55. I need to arrange it to execute tests to ensure that it does not break something, as happened with javiplx#100
from gitlab-hook-plugin.
@javiplx so we can expect to get a new version with this feature?
from gitlab-hook-plugin.
Related Issues (20)
- Hook execution failed: no project references the given repo url and commit branch
- Include GitLab group name in project name.
- Jenkins pipeline and Gitlab webhooks does not work HOT 1
- Support Violation Comments to GitLab Plugin
- NoMethodError - undefined method `getQuietPeriod' for nil:NilClass: when use webhook to trigger a pipeline?
- Generated job name: customize or omit the prefix
- System hooks not working for latest Gitlab (version 9)
- Double quotes are not escaped in commit message HOT 2
- How parametrized build could be performed
- Can't build project anymore HOT 4
- payload can't use dot(.) match
- Cann't trigger a build by merge request hook. HOT 2
- "undefined method `getQuietPeriod' for nil:NilClass" for jobs in folders
- How to read json payload from gitlab webhook in Jenkins HOT 1
- Cant call hook inside a folder with gitlab HOT 1
- ERROR: load error: openssl -- java.lang.VerifyError HOT 1
- Gitlab API token stored and displayed in plain text
- ruby-runtime plugin issue HOT 2
- installed this plugin but not working HOT 1
- CVE-2020-2096/SECURITY-1683 issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitlab-hook-plugin.