I want to set up a post-receive
git
hook that notify jenkins
about the change, but no job is triggered in jenkins
.
My post-receive
hook looks like this:
curl http://localhost/jenkins/git/notifyCommit?url=<git_repository_url>
If I issue the command in terminal, I get the following message:
"No git consumers for URI..."
I have a jenkins job that connected to Git Source Code Management, repository URL is given as well as branches: */master
I've searched for this problem, but I've found nothing useful related to: "No git consumers for URI"
I use:
I have a proxy setup in apache:
<Proxy *> Order deny,allow deny from all allow from 127.0.0.1 </Proxy>
The git repository is bare
.
Enable SCM polling for each project you want to notify:
The notification you send tells Jenkins to poll the repository, so projects will only respond if SCM polling is enabled.
The message No git consumers for URI
always shows up, you should be worried if you see No git jobs using repository
. The response will contain a list of jobs scheduled for polling, so as long as you see them, the polling was triggered.
That said you might want to check that polling is actually doing something. If you go into a job configured with Git, you can see a link to the Git Polling Log on the left. In there you'll be able to see if the trigger actually did anything and, more crucially, if there was an error.
I had an issue similar to this, and it took me a while to figure out that my Git was misconfigured. My job will build fine when manually triggered, but the polling trigger would use a different path to the Git binary and fail. I ended up having to define the Git path to fix my issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With