4

Some background: The project I'm working on is in SVN. Very very large. A lot of tests are running on Jenkins. I want to implement a new tests which should be executed only if files in certain directory have been changed.

The idea that I had was:

  • to trigger the job using a pollSCM every ten minutes
  • check the files in currentBuild.changeSets. If a file contains the directory, continue.
  • Only then I do a full checkout of the repository, compile, and run the tests.

But before I write the code, I was wondering when does currentBuild.changeSets? Will it have the required information when triggered by a pollSCM? I could not find this in the documentation

Yes, this could be done in a better way using git and hooks and other tools but that's what I have right now.

1 Answer 1

5

It will be set after any checkout steps (or derivatives of checkout such as git or svn).

So for instance:

println(currentBuild.changeSets) // should print an empty set

checkout(scm)

println(currentBuild.changeSets) // should print out any changes in the current build
1
  • I get this as output: hudson.plugins.git.GitChangeSetList@517831da May 15 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.