I hope this helps: How to trigger a Jenkins build on Git commit
It's just a matter of using curl to trigger a Jenkins job using the Git hooks provided by Git.
The command curl http://localhost:8080/job/someJob/build?delay=0sec
can run a Jenkins job, where someJob
is the name of the Jenkins job.
Search for the "hooks" folder in your hidden .git folder. Rename the "post-commit.sample" file to "post-commit". Open it with Notepad, remove the ": Nothing" line and paste the above command into it.
That's it. Whenever you do a commit, Git will trigger the post-commit commands defined in the file.