Use these instructions to set-up a Jenkins CI and these instructions to set up a Jenkins build job.

In order to test that the CI is working properly do the following:

  1. Use a git client (eg SourceTree) to clone your testing repository, eg: https://bitbucket.org/<TeamName>/jenkins-regression-test
  2. Modify the Ant build.xml by adding a reference to a non-existant .sql file, for example by adding a transaction line to the clean target:

    <target name=”clean”>
    <sql classpathref=”classpath” driver=”${sql.jdbcDriver}” password=”${sql.password}” url=”${sql.jdbcURL}” userid=”${sql.username}” >
    <transaction src=”${sql.scriptPath}/drop.sql”/>
    <transaction src=”${sql.scriptPath}/no-such-file.sql”/>
    </sql>
    </target>

  3. Commit and push your change
  4. In about five minutes, whoever set up the Jenkins job (probably you) should receive an email that the build is broken
  5. Undo your change and push the correction (you can right-click on a commit in SourceTree and choose “Reverse Commit”
  6. In another five minutes, whoever set up the Jenkins job should receive an email that the build is back to normal.

If all of this works then Jenkins is running and integrated properly with bitbucket and with the mail server.