Advanced Subversion Polling with Jenkins: File Fingerprints
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.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)