Reputation: 2230
I have configured Jenkins for my project using Docker and GIT build setup also done. I am able to take a build. I would like to configure Webhook for auto build. once I check-in the code, Build has to auto trigger in Jenkins. I have done below mentioned steps. But, it is not working. Help me on how to setup webhook ( auto build ) in Jenkins and Git Hub repository.
Jenkins is running behind NGINX by reverse proxy. I am using latest Docker Jenkins image.
Git Hub Configuration:
project repo -> settings -> webhooks - > add webhook URL: http://jenkinsusername:jenkinspassword@IP:port/jenkins/github-webhook/
jenkins = webcontext of Jenkins
Git Hub Recent Deliveries: success , response code : 200. But body is empty.
Response Header:
Connection: keep-alive Content-Length: 0 Date: Mon, 05 Dec 2016 01:53:08 GMT Server: nginx/1.11.4 X-Content-Type-Options: nosniff
Jenkins: project -> Build when a change is pushed to GitHub ( checked )
Guide me on how to setup auto build from GIT Hub to Jenkins.
Upvotes: 1
Views: 1672
Reputation: 837
Make sure you pushing code through correct branch,this is one of the most common mistake
git branch
Then Jenkins-> Job -> SCM -> Branches to build -> remove branch specifier and mention "**"
Upvotes: 0
Reputation: 2230
I have resolve this issue by below steps.
GIT Hub -> project repo -> settings -> Installed integrations ->Add Service -> Jenkins (GitHub plugin)
Jenkins hook url : http://jenkinsusername:jenkinspassword@IP:port/jenkins/github-webhook/
Click Test Service and check Jenkins build
Upvotes: 1