title: Jenkins & Git - Which is the most appropiate trigger to run tests?
body: <p>I'm developing plugins for a major system (Moodle), so Continuous Integration will be useful for me.</p>
  
  <p>The idea is to checkout Moodle stable version branches I want to publish the plugin for, to run the test with these versions.</p>
  
  <p>But as I've never worked with Jenkins nor Continuous Integration, I've no clear when would be the best moment to trigger the build that run the tests. These are the build triggers Jenkins offers:</p>
  
  <ul>
  <li>Trigger builds remotely (e.g., from scripts) </li>
  <li>Build after other projects are built</li>
  <li>Build periodically (cron-like; I don't think would be suitable)</li>
  <li>Build when a change is pushed to GitHub (could be)</li>
  <li>Poll SCM (can't see difference with the periodic build)</li>
  </ul>
  
  <p>Apart from these, we have the Git hooks, which at first sight I find them more interesting that what is above.</p>
  
  <ul>
  <li>Pre/post commit</li>
  <li>Pre/post merge (could be nice for triggering builds only for certain branches)</li>
  <li>Pre/post push</li>
  </ul>
  
  <p><strong>Note:</strong> Git plugin for Jenkins fails always when fetching Moodle repo, it seems because its quite long size (I don't know if Git plugin es necessary/important for this approach).</p>