Setting up webhooks with an independent git server?

I am using Jenkins for automatic integration and deployment. I would like the build to be done after every master commit.

So, I am posting a webhook post commit or message post trigger here and here and here .

So:

curl http://yourserver/jenkins/git/notifyCommit?url=<URL of the Git repository>

      

I am using an independent git server (so not github or bitbucket) and I would like to create this web key / trigger.

Any ideas on how to do this?

+3


source to share


2 answers


Webhook means you push to your Git hosting server that runs the JSON payload received by any server that needs to respond to a new push (like your Jenkins server).

But this is not exactly what you need if you are using the Jenkins hover API command allocated to the poll should die. "

You can put a post-receive hook in an inappropriate repo that you push to (server side) that the curl command will invoke.



And Jenkins Jobs needs to be configured with polling:

This scans all jobs that are configured to validate the specified url, and if they are also configured with polling, itll invokes polling immediately (and if this detects a change standing on the assembly, the assembly will run in turn.)

In the previous answer, you can see " How to set up a Git post commit hook ".

+3


source


Go to --bare

repo

go to folder hooks



Create a file named post-receive

Insert script code

0


source







All Articles