0

I have an local Jenkins server under localhost:8080 running, which is running in a Virtual Machine on debian7.

Host System is Windows8.

Now I want that every time I Push something from My hostsystem to mit bitbucket git repository the local jenkins server in the vm should pull the new commit and then starting a sonar Check on it.

How do I have to configurate jenkins that he pull the new commit automatically??

Sonar Qube is installed and running. Sonar Runner is also installed Git also.

Felix
  • 5,452
  • 12
  • 68
  • 163
  • 3
    possible duplicate of [How to configure Git post commit hook](http://stackoverflow.com/questions/12794568/how-to-configure-git-post-commit-hook) – Fabrice - SonarSource Team Mar 09 '15 at 11:05
  • thanks but whats not mentioned how to config the hook for a local server? which is not reachable from outside? .. – Felix Mar 09 '15 at 15:59
  • 2
    What I want is that the jenkins does a polling and checks (for example) every 5 minutes if the repo has changed ... and if thats true the build should start – Felix Mar 09 '15 at 16:06
  • 1
    Where do I have to put the hook? https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-Pushnotificationfromrepository on Host or on VM – Felix Mar 10 '15 at 08:44
  • Avoid poling and use the hooks instead. See [this answer](http://stackoverflow.com/a/28250478/734790) about using the [Bitbucket plugin](https://wiki.jenkins-ci.org/display/JENKINS/BitBucket+Plugin) in Jenkins. – Damon Mar 15 '16 at 21:06

1 Answers1

1

1 Does your Jenkins job working fine (as expected) when started manually ? 2 Does your Git commands (via commandline are working fine (as expected) in a shell on your debian ? 3 If it is the case .. you can then concentrate your study on to the configuration of Git In Jenkins. 4 Have a pass on the gloal Jenkins Configuration, (polling definition, git configuration)

5 If nothing better .. please, send more accurate information to help people pushing the finger on the the right issue.

thanks.

Jerome Vacher
  • 314
  • 1
  • 7
  • 1) yes job works fine manualle 2) yes I can use git normally from shell 4) what do you mean? – Felix Mar 10 '15 at 12:40
  • In Jenkins you configure things globally (for all jobs) and things for each job when you create one. – Jerome Vacher Mar 10 '15 at 13:08
  • 2
    If I understand clearly you just want to poll the git repository and start if changes occure. In this case just configure the SCM Trigger Configuration with something like H 0 * * 0-5. – Jerome Vacher Mar 10 '15 at 18:21
  • yeah thats exactly what I've doing now, because the hook dosn't work – Felix Mar 11 '15 at 14:49