I'm trying to set up jenkins so that when a commit on a repo is detected, the build in jenkins automatically triggers. I've been reading this post: How can I make Jenkins CI with git trigger on pushes to master?
But it's not clear to me where I create the git hook "post-receive". So far, I've tried two different spots:
- on the jenkins server, in the workspace folder that was automatically created for me when I set up this new project with the git repo specified.
- on the developer workstation I use to make my coding changes for this repo.
Neither one is working. This is what the post-receive file looks like:
me@jenkinslab:/var/lib/jenkins/jobs/test git repo/workspace/.git/hooks$ cat post-receive
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
curl http://10.1.1.11:8080/jenkins/git/notifyCommit?url=http://git.someinternaldomain.net/cgit/testing.git[&branches=branch1[,branch2]*][&sha1=<commit ID>]
In addition to creating this file, in my jenkins project, i have the "Poll SCM" option checked off under the "Build Triggers" section, but nothing as far as schedule defined.
Can you tell me what I'm missing?
Please and thanks.