1

I would like to know how to tell jenkins to trigger a build only when someone from team pushed changes to a project.

i tried :enabled polling in Jenkins(did not mention any polling time/no value) and enabled post-receive hook. And pushed changes to the same repository from a developer box(In this developer bix, we did not configure any hooks). This did not work.

when "post-receive" git hook get called?.

Cœur
  • 37,241
  • 25
  • 195
  • 267
vasu
  • 97
  • 10
  • So in Jenkins you've ticked "Poll SCM" but not set a schedule? Try `* * * * *` (poll every minute) – bcmcfc Dec 23 '13 at 14:45

1 Answers1

1

A proper way to solve this without putting undue load on your git server is via setting up a post-receive hook that would notify jenkins by calling a trigger endpoint. For this you will also need to configure jenkins by enabling the "Trigger builds remotely" checkbox. More on how to do this: https://stackoverflow.com/a/12794930/1068411

Community
  • 1
  • 1
Sergey Evstifeev
  • 4,941
  • 2
  • 24
  • 28
  • Thanks for the reply.I followed the first approach mentioned in the above link:1. Added below entry in post-reactive(curl 'http://wmosbuild-01.asia.manh.com:8080/git/notifyCommit?url=http://atlgit-01.us.manh.com:7990/scm/rndwm/te.git&branches=2013-maint') – vasu Dec 23 '13 at 17:42