Tag Archive for 'polling'

Subversion Tip of the Week

Polling Subversion with Jenkins

There are many advantages Jenkins can offer Apache Subversion users, one of which is the option of automatically polling Subversion repositories for changes, and creating a new build whenever changes are detected. In this week’s tip, we’ll show you how to configure Jenkins to automatically poll an uberSVN repository.

(Note, this tutorial requires Jenkins to be installed in uberSVN. See Getting Started with Jenkins in uberSVN for a step-by-step guide to getting Jenkins up and running.)

1. Open the ‘Jenkins’ tab and select the ‘New Job’ option from the left-hand menu.

2. Enter a Name for your job and indicate whether you are wanting to Copy Existing Job. Click ‘Ok.’

3. You will be taken to the ‘Configure’ screen. Enter a description for your job and select ‘Subversion’ as the source code management option. You will then be asked to enter the URL of the repository you wish to link the job to.

4. Under ‘Build Triggers’ select ‘Poll SCM.’ In the ‘Schedule’ text box, enter how often you want Jenkins to poll the repository. You can specify the frequency that Jenkins will poll Subversion, using the following format:

MINUTE HOUR DOM MONTH DOW
MINUTE: Minutes within the hour (0-59)
HOUR: The hour of the day (0-23)
DOM: The day of the month (1-31)
MONTH: The month (1-12)
DOW: The day of the week (0-7) where 0 and 7 are Sunday.

@annually, @yearly, @monthly, @weekly, @daily, @midnight, and @hourly are also supported.

5. Click ‘Save’ and Jenkins will begin automatically polling your Subversion repository at the specified intervals.

Not yet started with uberSVN? It’s free to download and free to use. Visit http://www.ubersvn.com/ now to get started.

Subversion Tip of the Week

Advanced Subversion Polling with Jenkins

It’s common practice to work on different projects simultaneously, but 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. Once you’ve configured a Jenkins job to poll Subversion, setting up file fingerprinting is made easy with uberSVN.

1. Select the ‘Jenkins’ tab, followed by the Jenkins job you previously setup to poll Subversion.

2. Select the ‘Configure’ option.

3. Select the ‘Record fingerprints of files to track usage’ option and specify which files to track in the ‘Files to fingerprint’ text box. In this example, trunk/*.zip will track all .zip files in the trunk.

5. Make some changes to the files earmarked for fingerprinting, and commit those changes as normal.

6. Open the build report in Jenkins and select ‘See Fingerprints.’

7. This screen will display some basic details about the tracked files. To drill down into the information on any file, select the ‘more details’ link.

uberSVN is free to download and free to use. Visit http://www.ubersvn.com/ now to download your copy.

Polling Subversion with Jenkins: More Options

Not only does uberSVN, the open ALM platform, make Apache Subversion easy, but users can leverage the functionality of other tools without even leaving their uberSVN installation. We’ve already looked at configuring Jenkins to poll an Apache Subversion repository, and using Jenkins’ file fingerprinting functionality. In this post, we’ll show how Jenkins’ polling functionality can be further configured to perform the following tasks:

  • Automatically sending out email notifications about broken builds.
  • Archiving specified artifacts whenever a new build is created.

Email Notifications

Jenkins can be configured to send email notifications whenever a build becomes unstable, fails, or returns to stable. uberSVN makes this configuration easy:

1. To get started, select the ‘Jenkins’ tab followed by the Jenkins job you previously setup to poll Subversion.

2. Select the ‘Configure’ option from the Jenkins side-menu.

3. Select the ‘E-mail Notification’ checkbox, enter the appropriate email addresses and click ‘Save.’

And that’s it! Now, whenever there are problems with your builds, Jenkins will automatically send out email notifications, allowing you to identify problems early.

Archive Artifacts

Jenkins can also be setup to archive certain ‘artifacts’ (i.e any results of your build process) whenever a new build is created. The advantages of archiving artifacts is that they’re easily accessible via uberSVN’s interface, and you only have to setup backup on your master.

1. Repeat steps 1 and 2 to open the ‘Configure’ screen of the Jenkins job that will be in charge of archiving.

2. Select the ‘Archive the artifacts’ option.

3. Now it’s time to specify which artifacts to archive. If you just want to archive one file, enter that artifact’s name and location. For example, to archive the Project Wiki text file in the trunk directory, enter:

trunk/Project Wiki.txt

Alternatively, you can configure Jenkins to archive every file of a particular format. If you wanted to archive every text document in the trunk directory, you would enter:

trunk/*.txt

Or, if you wanted to archive every .zip file in the tags directory, the command is:

tags/*.zip

4. At this point, you can optionally instruct Jenkins to overwrite previous artifacts by selecting the ‘Discard all but the last successful/stable artifact to save disk space’ option, which is accessible through the ‘Advanced’ menu.

5. Once you are happy with the changes you have made, click ‘Save.’

6. To see archiving in action, make some changes to the files you’ve configured Jenkins to archive and commit them back to the repository.

7. Once Jenkins has polled Subversion and created a new build, you will see new artifacts at the job’s status page.

8. Click on an archived item, to see its contents.

Need some extra support with your Jenkins+uberSVN installation? We offer Professional Support for Jenkins that provides:

  • 24-by-7 online, phone and email support.
  • Guaranteed response times.
  • Automated delivery of fixes and upgrades.
  • …and more!

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.