Tag Archive for 'ci'

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.

Subversion Tip of the Week

Quickstart: Getting Started with Jenkins and Subversion

The Jenkins open source continuous integration server can be a valuable tool for Apache Subversion users. It can be configured to watch for code changes in repositories, to automatically perform builds, to notify users, and perform other useful tasks on both remote and local machines. The easiest way to integrate Jenkins with Subversion, is through uberSVN and its integrated uberAPPS store. In this easy, five step guide, we’ll walk you through installing Jenkins in uberSVN.

1) Select the ‘uberAPPS’ tab from within ‘uberSVN’ to be taken to the store front, where you can select Jenkins.
2) From the Jenkins product screen, click ‘Download Now’ to download Jenkins.

3) Once the download is complete, click ‘Activate.’
4) You will notice a new Jenkins tab appear. Select this tab to go to uberSVN’s integrated Jenkins screen.

5) From here, you can optionally decide whether to make Jenkins visible to all users, or define exactly who can access the tool.

Get started with uberSVN now – download it for free from http://www.ubersvn.com/

Need more Subversion know-how? After getting a great response from the Apache Subversion community in 2011, Subversion Live is back for 2012, bringing the Subversion community sessions covering everything from Subversion’s future, to expert-led best practices workshops, as well as the unique opportunity to meet the core Subversion committers.

Configuring Jenkins: Security

The Jenkins continuous integration system doesn’t perform any security checks by default. While this may not be a problem in certain situations, if your installation is going to be exposed to the internet (or any other untrusted environment) it’s a good idea to implement some security checks. In this example, we’ll walk you through a common setup: allowing Jenkins to maintain its own user database, and then show you how to grant a specified user with full administrative privileges.

Note, this tutorial uses Jenkins and uberSVN. uberSVN is free to download and free to use, simply visit http://www.wandisco.com/ubersvn to get started.

1) Open the ‘Jenkins’ tab in your uberSVN installation and select the ‘Manage Jenkins’ option.

2) Select the ‘Configure Systems’ option.

3) Select the ‘Enable security’ option. This will bring up some additional options.

4) Select ‘Jenkins’s own user database’ under the ‘Security Realm’ heading, and ensure the ‘Allow users to sign up’ checkbox is ticked.

5) Under ‘Authorization,’ select ‘Matrix-based security.’ This will bring up a new table.

6) In the table select ‘Overall – Read’ for anonymous users.

7) Type your username into the ‘User/group to add” box and click ‘add.’ Your username will now appear in the table.

8) Make sure every permission for your username is ticked, to give yourself full access.

9) Select the ‘Save’ button at the bottom of the page. You have now configured Jenkins’ security settings!

Need more Subversion know-how? After getting a great response from the Apache Subversion community in 2011, Subversion Live is back for 2012, bringing the Subversion community sessions covering everything from Subversion’s future, to expert-led best practices workshops, as well as the unique opportunity to meet the core Subversion committers.

Jenkins: Configuring a Proxy

In most setups, the Jenkins server is behind a firewall, which can be a problem as Jenkins requires internet access to download plugins and updates. If you need to go through an HTTP proxy server, the connection details can easily be configured in Jenkins’ ‘Manage Plugins’ tab.

Note, this tutorial uses uberSVN. If you don’t already have uberSVN, you can download it for free from http://ubersvn.com/

1) Open the ‘Jenkins’ tab of your uberSVN installation.

2) Select the ‘Manage Jenkins’ link.

3) Click the ‘Manage Plugins’ link.

4) In the ‘Plugin Manager’ open the ‘Advanced’ tab. This will bring up your HTTP Proxy information. Enter the appropriate info – such as port, server, etc. – and click ‘Submit.’

Jenkins will now have internet access, and will be able to download updates and plugins.

Updating Jenkins

To download Jenkins plugins, simply click the ‘Available’ tab of the ‘Plugin Manager’ to see a list of available plugins.

Updates for your installed plugins can be found in the adjoining ‘Updates’ tab.

Once you’ve configured internet access, you’ll have access to updates for Jenkins itself. To check for Jenkins updates:

1) Open the ‘Administration’ tab, followed by the ‘Updates’ tab.

2) Click the ‘Check for Updates’ tab to ensure you have all the latest updates.

3) You will then be able to see – and install – all the latest Jenkins updates.

Not yet started with uberSVN? It’s free to download, free to use and integrates seamlessly with Jenkins. Simply visit http://www.ubersvn.com/ to find out more.

Need more Subversion know-how? After getting a great response from the Apache Subversion community in 2011, Subversion Live is back for 2012, bringing the Subversion community sessions covering everything from Subversion’s future, to expert-led best practices workshops, as well as the unique opportunity to meet the core Subversion committers.

Bringing Order to Your Jenkins Jobs

Once you’ve been working with Jenkins and uberSVN for a while, you may find yourself in a situation where you have several jobs that need to run in a specific order, for example:

  • Job 1 and Job 3 can run simultaneously.
  • BUT Job 2 should only start when Job 1 and Job 3 have finished running.
  • AND Job 4 should only start when Job 2 has finished.

How can you implement this complicated setup? This is where Jenkins’ ‘Advanced Project Options’ and build triggers come in handy. In this tutorial, we’ll walk through the different options for scheduling jobs using Jenkins and uberSVN, the free ALM platform for Apache Subversion.

Note, this tutorial assumes you have already created a job and configured it to automatically poll your Subversion repository.

1) Open the Jenkins tab of your uberSVN installation and select a job.

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

3) In the ‘Advanced Project Options’ tab, select the ‘Advanced…’ button

4) This contains two options that are useful for ordering your jobs:

  • Block build when upstream project is building – blocks builds when a dependency is in the queue, or building. Note, these dependencies include both direct and transitive dependencies.
  • Block build when downstream project is building – blocks builds when a child of the project is in the queue, or building. This applies to both direct and transitive children.

If this option doesn’t meet your needs, you can explicitly name a project (or projects) that must be built before your job is allowed to run. To set this:

1) Scroll down to the ‘Build triggers’ tab on the configure page.

2) Select the ‘Build after other projects are built’ checkbox. This will bring up a text box where you can list any number of projects.

Utilized properly, the build triggers and advanced project options should allow you to organize your jobs into a schedule. Tip, if you need even more control over your build schedule, there are plenty of scheduling plugins available. To add plugins to Jenkins, simply:

1) Open the ‘Manage Jenkins’ screen.

2) Click the ‘Manage Plugins’ link.

3) Open the ‘Available’ tab and select the appropriate plugins from the list.

Not yet using uberSVN? It’s free to download, free to use, and is seamlessly integrated with Jenkins. Simply visit http://www.ubersvn.com/ to get started. A professional support option for Jenkins is also available.

Polling Subversion with Jenkins: The Quiet Period

Ever hit ‘Enter’ on your ‘SVN Commit’ command only to realise you’ve forgotten to include some files? In Apache Subversion, it’s not unusual for one commit to be quickly followed by another, as users realise their mistake. If you’ve configured Jenkins to poll Subversion for changes, this can result in broken builds and premature email notifications about build failures. Thankfully, if you’re a Jenkins user, there’s a ‘quiet period’ feature that can be activated to provide some breathing space between performing a commit, and Jenkins generating a build. If you’re using uberSVN, this is simply a matter of checking the right tickbox.

Note, uberSVN is free to download and free to use. If you’re not already using uberSVN, you can get it for free from http://www.ubersvn.com/

To introduce a ‘quiet period’ to your Jenkins workcycle, you must first create a job and configure it to automatically poll your Subversion repository. Once your job is up and running:

1) Open the Jenkins tab of your uberSVN installation and select the job you want to add the ‘quiet period’ to.

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

3) In the ‘Advanced Project Options’ tab, select the ‘Advanced…’ button.

4) Select the ‘Quiet period’ box and enter the number of seconds Jenkins should wait before generating a build.

Your Jenkins job will now schedule a build, but then wait 20 seconds before actually beginning to build.

Want to learn more about Jenkins jobs and polling? We have plenty of free tutorials you may be interested in:

Getting Started with Jenkins in uberSVN
Polling Subversion with Jenkins
Advanced Subversion Polling with Jenkins: File Fingerprints
Polling Subversion with Jenkins: More Options

If you need extra help with Jenkins, we also offer a professional support option that includes 24-by-7 online, phone and email support, guaranteed response times and automated delivery of fixes and upgrades.

10 Best Practices for Version Control

Used correctly, version control is an invaluable tool – but following some basic guidelines can help you get even more out of your version control system. In this post, we share ten best practices for getting the most out of version control.

1) Version control everything…..

Version control is no longer just for source code management. Thanks to user-friendly and intuitive tools such as TortoiseSVN and uberSVN, version control is increasingly becoming a tool for programmers and non-programmers alike. Consider encouraging every member of your team (including the non-techies) to keep all files and folders related to your project under version control. This could include meeting minutes and whiteboard notes, architectural designs and user documentation. Even for documents that are unlikely to change, it’s useful to have everything in one place and available to everyone on the team.

2) …but don’t treat version control as a backup system

Although version control does provide you with a backup of your files and folders on a remote server, using your version control like a backup system is a bad habit that doesn’t make the most of the system’s unique functionality (although it is possible to backup your Apache Subversion repositories.)

3) Commit easily readable documents

If you’re committing documents that require formatting before they can be read, consider committing them in a more accessible form, such as a PDF. In addition to making documents quicker and easier to access, this allows you to refer people directly to a document in the repository. However, remember to update both versions of the document when you make changes (or better yet, automate this process.)

4) Be consistent with your file/folder names

Implementing a logical naming convention will make it easier to locate particular items. Ideally, this naming convention should be explained in a coding conventions file, which is accessible to all members of your team, and this convention should extend to all the projects in your repository.

5) Commit little and often

Commit small changes frequently, instead of committing many small changes bundled into one large chunk. This will reduce the chances of encountering complications such as merge conflicts, and will reduce the complexity of such conflicts when they do occur.

6) Only commit finished work

Never commit half-completed code. This seems to go against the concept of ‘commit little and often,’ but the solution is to split the task you’re working on into manageable but logical pieces, and then commit these regularly.

7) Update regularly

This ties into the concept of ‘commit little and often.’ Perform regular updates on your working copy, to keep up to date with the changes being made in the trunk. This is important, even if it seems your current work has little to do with the rest of the team. It is also good practice to update your working copy before making any changes.

8 ) Make use of log messages

Always make use of log messages, and make sure you include as much information as possible (what changes were made, why, and by whom, etc.) If the commit deals with a specific bug or change request, include the issue or bug number in the log message.

9) Implement a sane project layout

Maintaining a version control system can become a complex task, so implementing a logical project layout from the beginning is crucial. Some version control systems, such as Apache Subversion, don’t impose a strict project or repository structure, which makes planning your layout in advance even more important.

10) Test, test, test

Get into the habit of systematically testing everything, especially before you perform a commit or a merge. Also consider CI and assertion testing on feature branches, which is a useful way to indicate code maturity and progress.

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.

WANdisco Attends Jenkins User Conference

The Jenkins User Conference took place in New York yesterday, and members of the WANdisco team were lucky enough to be at the event. The Jenkins User Conference brings Jenkins experts and community enthusiasts from around the world together for a full day of learning and networking opportunities, focused on the popular open source continuous integration server.

The WANdisco team had a great time attending the different sessions, which covered all the latest and greatest Jenkins technology and best practices, and featured hands-on workshops and demos.

We’re all big fans of Jenkins at WANdisco, and are looking forward to putting what we’ve learned into practice – thank you to CloudBees and of course, the Jenkins community, for putting on such a great event!

As a proud CloudBees partner, not only did we attend JUC NY, but we’re sponsoring two of the conferences. “We are thrilled to have WANdisco join CloudBees and the other sponsors in supporting the Jenkins community,” said Kohsuke Kawaguchi, creator of Jenkins.

Missed out on all the fun? Team WANdisco will also be attending the San Francisco JUC in September. We’re looking forward to meeting even more of the Jenkins community (and maybe even some of the Jenkins+uberSVN community) then!