Archive

Archive for August, 2012

Jenkins Git Server Plugin

August 31st, 2012

Jenkins Git Server plugin is a so-called “library plugin”, which doesn’t offer any user-visible feature by itself, but instead enables other plugins to do something easily inside Jenkins. In case of Git server plugin, it allows other plugins to easily embed Git server functionality (via JGit) — create/manipulate Git repositories in the Jenkins server, expose it via SSH and HTTP transport for push/pull, and maintain local check out of those repositories.

As an example of how to use this plugin, I wrote Git userContent plugin. This plugin exposes the $JENKINS_HOME/userContent directory as a Git repository, and enables administrators to use git to push/pull changes and manage them with history.

In terms of code, there are two classes that plugins like git-userContent-plugin should be interested in.

One is HttpGitRepository, which represents Git repository access via HTTP. Typically you have some directory inside $JENKINS_HOME that houses the repository, then you subtype GitHttpRepository and override abstract methods to fill in the missing details. FileBackedHttpGitRepository is a convenient default implementation that simplifies this further. GitUserContentRepository in git-userContent-plugin is an example of using this class. This use also implements RootAction to bind this repository at http://server/jenkins/userContent.git, and I expect this combination to be fairly common.

The other class of interest is RepositoryResolver. Git server plugin adds necessary Jenkins SSH CLI hook for exposing Git repositories over SSH. The only missing link here is that when the client runs “git clone ssh://server/foo/bar/zot.git“, we need to figure out what repositories on the server corresponds to /foo/bar/zot.git, and that’s what the RepositoryResolver extension point does. The sample implementation in git-userContent-plugin will be hopefully self-explanatory. In this case, GitUserContentRepository is a singleton (because it’s RootAction), so we inject that and basically just delegate the calls to it.

I’m looking forward to seeing more plugins take advantages of this feature to expose data over Git repository. I think there’s a lot of interesting uses to it.

jenkins

Meetup “Automated testing & continuous deployment for mobile apps” tomorrow

August 29th, 2012

Mark Prichard from CloudBees, myself, and Matt Solnit from SOASTA will deliver a joint talk Thursday evening at Silicon Valley Cloud Computing Group.

Our part of the talk will take an iOS application and a backend Java server, then discuss how you can set up the pipeline of continuous build and test for them on Jenkins. The demo will be based on the CloudBees platform and we think it’s easier to do it that way than setting everything up on your own, but the setup should equally apply to your local Jenkins installation.

The part of the talk from Matt highlights SOASTA’s CloudTest product, which is basically a robot tha emulates user interaction on the device. My understanding of this is that it’s similar to Frank and KIF, but it comes with a recorder that lets you do “programming by example” — you manually interact with the test target app, and the recorder will turn that into a test scenario (Selenium IDE, anyone?)

Apple has locked down the iOS application development and distribution which makes the automated testing setup more painful than it should be, but because of that, I think a talk like this that shows the whole setup is worthwhile.

The event will be Thursday evening, at Yahoo! Campus in Sunnyvale. Please join us if you can. The event is free but requires RSVP. Beer and pizza are provided.

jenkins , ,