DevOps Zone is brought to you in partnership with:

Jessica Thornsby is the Technical and Creative Copywriter at WANdisco, where she writers regular tutorials on Apache Subversion, TortoiseSVN, uberSVN, and all things version control. She spends her spare time editing the CD reviews section at www.leedsmusicscene.net, contributing to A Short Fanzine About Rocking, and researching her family tree. You can find her on Twitter @jthornsby Jessica is a DZone MVB and is not an employee of DZone and has posted 29 posts at DZone. You can read more from them at their website. View Full User Profile

Advanced Subversion Polling with Jenkins: File Fingerprints

06.02.2012
| 4701 views |
  • submit to reddit

In ‘Polling Subversion with Jenkins’ we showed you how to configure Jenkins to poll an Apache Subversion repository once every five minutes. In this follow-up post, we’ll explore some advanced options you can introduce once you’ve implemented the basic polling system. This post will show you how to configure Jenkins to automatically track versioned files using ‘file fingerprinting.’

In the world of modern software development, it’s common practice to work on different projects simultaneously. With so much going on, it’s easy to lose track of where files originated, and what version is being used by which project. Thankfully, Jenkins supports file fingerprinting, which allows you to see exactly when and where your files are being produced and used, and even to upload a file from your local machine and query Jenkins on its version number. File fingerprinting works by creating a database of MD5 checksums, which gets updated automatically as new versions of fingerprinted files are committed to the repository.

How To: Setup File Fingerprinting

1. To enable file fingerprinting in uberSVN, simply select the ‘Jenkins’ tab, followed by the Jenkins job you previously setup to poll Subversion.

2. Select the ‘Configure’ option from the left-hand menu.

3. Tick the ‘Record fingerprints of files to track usage’ option.

4. Specify the files to track in the ‘Files to fingerprint’ text box. In this example, trunk/*.txt will track all .txt files in the trunk (if you wanted to track all .zip files in the tags directory, you would use tags/*.zip)

How To: Test Your File Fingerprinting

1. To test your setup, make some changes to the files earmarked for fingerprinting, and commit those changes.

2. Open the build report in Jenkins, and select ‘See Fingerprints’ to view the recorded fingerprints.

3. This screen will display some basic details about the tracked files, including the original owner, and how old the information is. To see more, click on the ‘more details’ link.

4. On this page, you can see all the jobs and builds where the file has been used.

How To: Check File Fingerprint

Another benefit of enabling file fingerprinting, is that if you have a file on your local machine but are unsure of its version number, you can upload it to Jenkins and check the fingerprint against Jenkins’ fingerprint database.

1. Start by selecting the ‘Check File Fingerprint’ option from the main Jenkins dashboard.

2. Upload your file and select ‘Check’ to run it against Jenkins’ database of file fingerprints.

3. Jenkins will then display all the information about the uploaded file.

Not yet started with uberSVN? It’s free to download and free to use! You can download the latest version now from http://www.ubersvn.com/ If you need some extra support with your Jenkins+uberSVN installation, Professional Support for Jenkins is also available.

Published at DZone with permission of Jessica Thornsby, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Evgeny Goldin replied on Sun, 2012/06/03 - 1:33pm

What we used in my place is adding textual "about" files to every archive created. These files contained a detailed info regarding SVN revision, build number, Java version, etc. So for every archive created anyone could see when and it was created, from what revisions and by which Jenkins build. There are Maven and Gradle plugins for doing that, TeamCity / Jenkins / Hudson + Svn / Git are supported.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.