Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I got a request from the man upstairs to setup Jenkins for Pretested commit (through a build at Jenkins, if all unit tests and other pass then commit it and build a dist). We're using svn here.

Is anyone clear about how this can be done with Jenkins? I am finding next to no information on it.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Sorry to say that, but that's just not the way you use revision control software. You have full history on the server no matter what you do on the client. You can revert any change, including deletion of everything. Committing only fully tested, battle proven code to revision control gives you absolutely no benefits of using revision control in the first place.

What you could do is this: mark one branch as stable (this should be either /trunk or /braches/current-stable, I'd suggest the latter), let developers commit everywhere else. Setup Jenkins to do testing on /trunk and merge commits from trunk to current-stable only when they pass build tests.

share|improve this answer
I am resolved to agree with you. I was thinking of an svn hook but then it starts to get hairy. Thanks. –  Slamice Jan 28 '12 at 3:42
add comment

I assume that the "man upstairs" is aiming at a master branch/trunk that is always in a releasable state, hence the requirement of pretesting. This is inherently difficult with a centralized revision control system like Subversion and will most probably involve some sort of automatic branch-juggling & merging.

I personally use git in conjunction with Gerrit (http://code.google.com/p/gerrit/), a code-review tool together with Jenkins. Developers pull from a master branch but push to a "staging git repo" hosted by Gerrit. Gerrit in turn reacts by triggering a jenkins build job for the change. If all tests pass, Gerrit accepts the change and merges it into the master branch.

share|improve this answer
add comment

You could also use the Svn Revert Plugin in Jenkins.

Using that it would revert commits that turns the build unstable which removes the need of a "Pretested commit".

(I am the author of the plugin).

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.