Question

I have made a checkout in my directory of an SVN repository. The project take a lot of time to be completely checked. And so while creating my Hudson job I need this in order :

  1. Clean up the directory (this resolves some ambiguous problems such as : "Hudson workspace locked while building" )
  2. Revert the changes
  3. Update

The choices that I have for Check-out Strategy, in the Hudson job creation form, are:

  • Use svn update as much as possible, with 'svn revert' before update
  • Use 'svn switch' as much as possible
  • Use 'svn update' as much as possible
  • Clean checkout folders and then checkout
  • Emulate clean checkout by first deleting unversioned/ignored files, then 'svn update'
  • Clean workspace and then checkout (Eliminated)

What is the right option for my case?

Thank you a lot!

Was it helpful?

Solution

If your build is done correctly, you should be able to simply do use 'svn update as much as possible. This is the fastest way to update your files. This means not modifying committed files, or placing build artifacts in directories where they will interfere with the build process. In a Java shop, simply keeping all built objects in a subdirectory (we use target to match Maven, but others use build or diet) and out of the way of the rest of the process.

Most people do a clean as part of their build step. This, in theory, should not be necessary, and doing so will lengthen build times. The idea of the build is not to do any unnecessary work. If a source file isn't changed, the corresponding object file should not need to be rebuilt. However, Java is pretty fast at compiling, that most Java projects simply wipe the build directory clean. In C projects, not deleting old objects is better since it really reduces build time.

If there is a problem with your build process where use 'svn update' as much as possible can't work, you should fix your build process. However, there are a couple of projects on our old Jenkins server that do have problems, and they simply aren't updated enough to worry about it. For those, I do Always checkout a fresh copy. This takes the longest, but if you're having problems with your build process, I wouldn't bother using emulate a clean checkout by first deleting unversioned/modified files and use svn revert first. These can cause update conflicts, and cause problems with your build. Either get the build working correctly, or do a clean checkout.

OTHER TIPS

I would go with "Use svn update as much as possible, with 'svn revert' before update". If that is not sufficient, check out the EnvInject Plugin. It can run a script before the SCm checkout happens. You can use it to run a svn cleanup for your job, before the Subversion plugin takes over with the revert and the update. Caveat, you need to install some kind of SVN command line client on your build server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top