Tracking configuration changes in Jenkins

Continuous Integration is a pretty common concept these days. The idea of a “robot buddy” which builds and runs a bunch of tests across a whole codebase every time a change is checked in to the source code repository seems a generally good idea. There are a range of possibilities how to achieve this, and one of the most popular is Jenkins, the open source version of Hudson, originally a community project but now owned by Oracle.

Although Jenkins is a useful tool, it can be a bit fiddly to set up, with a lot of web-form-filling to configure it for your projects once the basic web app is installed. Most projects I have worked on which use Jenkins have started by working through this setup using trial and error, then stuck with something which seemed to work. In an optimistic world this is OK, but it fails whenever there is a problem with the machine running the CI service, if another one is required, or if someone makes a change which breaks the configuration and the team needs to quickly roll back to a working config. In short it’s like software development used to be before we all used version control and unit tests!

With all this in mind, I was interested to read an article about a Jenkins plugin for version-controlling the configuration. This could be a step in the right direction.

Tracking configuration changes in Jenkins – cburgmer's posterous.

If you use Jenkins this seems a very good thing to try out. I still feel, though, that all this configuration does not really belong in a CI tool. It’s really just some instructions about how how to build, deploy, and test the product, and to my mind that’s the kind of stuff which belongs with the code itself.

Imagine how simple things would be if there was no need for a whole CI “server”, but we could just use a simple git hook which called something managed, edited, tested and checked in with the code itself.

Using Markdown in GitHub Pages

I really like the idea of GitHub Pages, and the way that it helps to manage the documentation for a project, bringing it in line with the same practices and tools used to manage the software development process. Of course, I would have been slightly happier if GitHub had chosen to use my own broadly-equivalent site-generation tool “Site Grinder” rather than Jekyll, though ;)

Most of the example sites linked from GitHub use html or textile for page layout, but I quite like Markdown, and wanted to use that instead. According to the Jekyll documentation, markdown is supported, but it took several attempts to get GitHub pages to recognize and transform my Markdown encoded project home page. The trick was to ignore the implication in the Jekyll documentation about file extensions. Example textile files have a “.textile” extension. Example HTML files have a “.html” extension, and so on. However, Markdown files only seem to work if they have a “.md” extension. Other common possibilities such as “.mkd” or “.markdown” are not recognised, and result in the raw file content being passed to the browser.

Stringtree and Mojasef now on GitHub

It’s been a long time coming, but I have finally decided that the master source code of the Stringtree and Mojasef Java libraries will now be hosted at GitHub rather than Sourceforge. I have been using git to manage the rest of my software for a long time now, but my two main projects have kept their place in subversion at Sourceforge. From now on, if you want the latest source code for either of these projects, please get it from github.

This move has several major advantages. The first is that you can now use GitHub’s “social coding” features to fork and modify the Stringtree and Mojasef code (and I’m always happy to discuss changes and improvements). The second advantage, and the one which tipped me over, is the ability to use git’s clever “submodule” support to include up-to-date Stringtree and Mojasef source code in other projects.

In the short term I will also be keeping the svn repositories up to date with significant changes. For now they are also the best place to find example code which uses Stringtree and/or Mojasef, but I plan to move all the examples over to GitHub in time.

Please let me know if you have any issues or questions about this move.

Assembla now offers free private svn and git repos

Just when I thought private project hosting choices had settled down in favour of Unfuddle, along comes a potentially game-changing announcement from Assembla.

My big problem with Assembla has been that they equated one project (“space”) with one source repository, and charged extra for extra spaces. Each extra space gives extra issue tracking, documentation storage and so on. This might make sense in a traditional centralised subversion model, but it’s completely alien to git, where a project is commonly represented by a network of repositories.

As of 14 April, Assembla now offers unlimited repositories with each space, allowing a single project to share issue tracking, documentation, activity notifications etc. across multiple repositories. If you don’t need the rest of the features, they also now offer basic private source repositories for free, presumably with the idea of up-selling the other services.

Assembla seem to have slightly better tools than Unfuddle, but its hard to tell as they still don’t offer a real, private, non-expiring, “try before you buy” like Unfuddle does. With Assembla you get a month’s usage before you have to start paying, and their cheapest plan is $24 per month, considerably more than Unfuddle’s “micro” plan of $9 per month.

Both services are free for open-source projects, but then so are plenty of others (sourceforge, github, and so on.)

For the moment, I am still happy with Unfuddle, but I’m keeping an eye on Assembla.

Ruby, Sinatra, Dreamhost, Haml, git – a smooth web app workflow … eventually

I have spent many years developing web applications in Java for corporate clients. During that time I have used a wide range of frameworks, APIs and other useful stuff. I have written my own versions (sometimes several) of many of these components, learned the tools well, and become very productive and effective.

However, it has been almost impossible to take that expertise, hard work, and custom code and easily/cheaply turn it into usable web applications for general public use. Low-cost hosting providers have generally shunned Java support. The most reasonable one I have found is LunarPages who actually support both ad-hoc JSP and deployment of custom web applications as war files, even though you have to search pretty deep in their web site to find out, and pay an extra dollar or two a month for the privilege.

So for my own projects I have been looking for an alternative for a long time. A way of developing and testing web apps on my various development boxes (currently running Ubuntu, MacOS X and Windows XP) and easily deploying to a low-cost hosting provider.

By far the most popular web development language is PHP. It’s available pretty much everywhere. It’s so focussed on web app development that the primary unit of coding is the web page. Believe me, I have tried to like PHP, but it’s just so clumsy. After a few paces the application begins to get tangled, development speed drops, and bugs creep in. Its web focus makes it tricky to unit test, and end-to-end testing seems to require a full-fat HTTP server. Not for me.

Beyond the traditional stomping ground of PHP, perl, and other CGI fodder is the new range of “trendy” languages. Ruby, Python, Erlang and even the venerable smalltalk are trying to position themselves as the thinking-person’s web development tool.

Erlang syntax is a bit too odd for me right now, although I may come back to it later. Smalltalk is interesting, but carries with it so much history and is hardly a popular choice for low-cost hosting providers. That leaves a short-list of Python and Ruby.

As languages I like both Python and Ruby. They have broadly similar design goals, both have keen developer communities with plenty of open source resources, and both are commonly found on linux-based web hosts. In order to decide between them I took a look around their frameworks and APIs.

Python has Google on its side. It’s the “native language” of the hugely-scalable Google AppEngine. However, a scan around the web looking for ways of writing web applications led largely to two: Zope and Django. (for balance, there are plenty of others, but these are the standout examples). Zope is old and sprawling. It has some great ideas but is hardly an obvious choice for small, tactical web apps. Django is a bit lighter, but still seems to assume a lot and require a lot of relatively fiddly config.

In the Ruby world the blindingly obvious choice for a web application framework is Rails. Sometimes it seems as if “Ruby” is just another way of saying “Rails”. However Rails, like Django, assumes a lot about the eventual application. Rails also makes a lot of use of code generation, which I simply do not like. I would always prefer that a framework eliminate boilerplate rather than just generate it for me. Looking a little further beyond Rails I came across some really interesting alternatives, and the one which really sparked my interest is Sinatra. For me this one framework made the difference. It’s so streamlined that a basic web app is as simple as:

require ‘sinatra’
get ‘/’ do
‘Hello world!’
end

Best of all, simply running the above file using ruby hello.rb starts up a web server and begins serving pages on port 4567. No extra config or faffing.

Looking around for low cost hosting I found that the provider I already use (Dreamhost) supports Ruby web hosting using Passenger. An ssh to the Dreamhost server for “gem install sinatra” followed by a little bit of FTP and my first Ruby/Sinatra application was live!

A key part of any web application is the pages, and a key part of generating pages is a good template language. As a general-purpose templating language, I still prefer my own Stringtree Templater, part of the Mojasef Java framework. So far I have not found a similar templating solution for any other language. However, for the limited and specific requirement of generating web pages, I am becoming quite fond of Haml. It’s not at all a general templating solution, but it does massively simplify the generation of web pages.

Finally, after years of CVS and Subversion, I have made the jump to distributed version control. Not only is it more trendy, but the ability to work on multiple code branches, on multiple machines, with or without an internet connection, and easily share, identify and merge when necessary has been a key benefit. Occasionally I wonder if one of the other distributed VCS (Mercurial, Bazaar, darcs, etc.) would have been a better choice, but I needed to settle on one and get to grips with it. So I chose git.

There have been a few speed-bumps. Attempting to learn git from manual entries and simplistic tutorials gives very little help on deciding what is worth doing. After about a week of following the techniques in A Git Workflow for Agile Teams, though, I began to get comfortable. Add to that some lovely web deployment tricks from A web-focused Git workflow and a selection of GUI tools ( Git Cola, GitX, and Git GUI ) to get round all that tedious “git add” stuff and simplify infrequent operations, and git becomes a very useful and productive tool.

The upshot is that I currently feel very productive.

My toolbox has a few other things in it, but they are still candidates for change if I find anything better. I am managing my projects and git repositories using Unfuddle but it has a few shortcomings including a ticket system which is a pale and clumsy cousin of bugzilla. For editing I use generic syntax-highlighting text editors (gedit on Linux, TextEdit on Windows and Smultron on Mac) but none of them have the nice autocompletion and refactoring tools I grew addicted to in Eclipse. Suggestions welcome!

Finally, a few spare links relating to the tools mentioned above.

Sinatra: 29 Links and Resources For A Quicker, Easier Way to Build Webapps

HAML reference

Rack

Mini reviews of 19 Ruby template engines

The Forgotten Ruby Web Frameworks

Distributed Source Control as a tool for Set-Based Design

I’m currently spending a fair amount of time on evaluating distributed version control systems (DVCS) such as git, bazaar and mercurial. Some things which were easy using a centralized version control system such as subversion or cvs seem more complicated, but I am now starting to find ways of using DVCS to do things which the old systems simply could not manage.

It took me a whole evening of fiddling, but I have now set up git to allow me to make chanches to a local version of one of my web sites and commit changes as I feel like it, then when I am happy, send the changes to the live web site with a single git push. This has been working well for a few days, so I plan to roll out a similar structure to the rest of my web sites soon.

Another interesting use for DVCS was pointed out by Francisco Trindade. Distributed version control can help to enable “set based design“. This is a technique where a team samples a wide range of possibilities to converge on a “sweet spot” where market need, business value and manufacturing efficiency are balanced.

reliable web app deployment using git and Resin

I have always liked the Resin application container. I often use it to develop servlet and J2EE applications, even ones which are eventually deployed on another server. Resin is fast, clean, and easy to manage. Its cool ability to run PHP as well as java is a bonus.

Now it’s even cleverer, and it includes a bit more trendiness.  Resin 4.0 supports a git repository as the underlying storage for web applications, with all the versioning and updating benefits which that implies.

Read more at Caucho Technology » Blog Archive » reliable deployment using .git.

Some decent looking project hosting candidates at last

As you may recall from a previous post, I am looking for some decent project hosting both for my open source software and for some business ideas. I want a single point of contact which offers as a minimum: version control, wiki, bug/ticket tracking, calendar and tasks/todo. Nice to haves include time-tracking, collaborative planning and continuous integration.

Eventually I have found two likely candidates: unfuddle and assembla. Both offer most of what I want, but with a few differences.

Unfuddle is probably the simpler of the two. It offers subversion and git hosting, a kind of wiki called “Notebook”, a kind of low-rent bulletin board called “Messages” for discussions, deadline management using simple text milestones, and bugs/tickets using Trac. It also provides RSS and iCal feeds of workspace events and upcoming milestones. With increased monthly payment you can also get time tracking and file attachment storage for messages.

Assembla offers subversion, mercurial and git hosting (and can integrate with remote subversion and github repositories), a wiki with extensions to directly reference tickets, bugs, software versions etc., similar “messages” to unfuddle but with file attachment storage included, bugs/tickets using trac or a proprietary alternative, similar milestones to unfuddle (but I can’t find any iCal feeds which is a shame), time recording, scrum-style progress reporting, and a few other options such as a “chat” facility and a specialist repository for storing and annotating images. It can provide updates of events using twitter or by HTTP call-outs, which seems pretty flexible.

Neither one seems to have a very sophisticated calendar, so no arranging meetings etc. Neither one has any significant collaborative planning in the vein of Mingle or Silver Catalyst. Neither supports recording of anything other than time (money spent on each task would be very useful, for example.) And neither supports continuous integration as such (although it could probably be hacked together using Assembla’s HTTP call-outs.)

Pricing seems roughly similar, although calculated differently.

Unfuddle offers five price bands (free for open source, $9, $24, $49, and $99 per month). Each band offers larger quantities of storage, numbers of participants and projects etc. The $9/month plan offers 512MB of storage for 10 people on 4 projects, so for an example small private team of three developers the cost would be $9/month

Assembla determines pricing per user per “space” (a space seems roughly to equate to a single project). Free for public spaces. For private ones, each user/space is $2/month, and $3 per gigabyte of storage per month. So for the same small private team of three developers the cost would also be $9/month but for more features and more storage. The down side is that adding any new team member, even one who only needs occasional access, costs extra.

I have registered for free accounts on both systems and have started to try out everything I can. I’ll report back soon on my findings.

In the meanwhile I’d love to hear from anyone with any other suggestions for project hosting services along the lines of these two.

GIT 101

A collection of useful links and tutorials about using the git version control system.

GIT 101 | Xebia Blog

Searching for the perfect project hosting

I’m still searching for decent project hosting. I now have several projects on the go, and several others bumping around in my head, and the fuss and bother of tying together all the various bits of a distributed software project development is making my head hurt.

All the bits I need are available separately, but so far I have not been able to find any single provider (free or paid for) which offers the combination of features I need. Essentially these are:

  • Version control. Ideally git, but at a pinch one of the other distributed VCS tools or even subversion would probably do if everything else was in place. GitHub seems good for this.
  • A project wiki. Using any other system for project docs just seems so clumsy. There are plenty of these; I use WikiDot for one project.
  • Sensible bug/feature tracking. This is a bit more tricky – there is plenty of bug-tracker software, but not much that works equally well for managing unimplemented feature stories and associated tasks. Ideally this should link in with the version control, allowing code and change metadata to be updated in one go. Trac seems a possibility for this.
  • Calendar management. For recording and communicating meetings, deadlines etc.. Something which works well with calendar syndication, so that anyone working on the project can see project events in with the rest of their appointments. Plenty of these: Google calendar, 30 boxes, etc. They all have their quirks, though.
  • Task (todo) management. I find it amazing that task management is so poor in on-line calendars. There are standalone task tools such as Remember The Milk, but it is integration which is needed.

There are also a few other features which are definitely in the “useful to have” category, but I’m practical enough to use manual or off-line tools if necessary.

  • Effort recording, tracking and reporting. For velocity tracking, process improvement, and even billing.
  • Collaborative planning and prioritisation. Mingle tries to simulate a task wall, but is somewhat clumsy and irritatingly expensive; I have heard of on-line tools to run “Planning Poker” sessions, but as usual, not integrated with anything else.
  • Continuous Integration. I’m not aware of any really smart tools to make use of distributed version control for this, yet. Our Cruise Control installation just stops and complains when something breaks, for example, but it should be possible to just “park” the failing patch and continue building with others in a real dvcs-based approach.

If anyone has any suggestions – or wants to build a product which does all this stuff – please let me know!

For interest, here are a few associated links.

Cuberick: Distribute Your Software Just Like Ubuntu With Launchpad

Comparison of open source software hosting facilities: Wikipedia

Using GitHub as a blog

What a cool idea. Using GitHub as a blog.

raganwald’s homoiconic at master — GitHub

Git/Github Roundup: Ruby Books, Gems, Gitjour

I guess this a bit old by now, but I hope they continue with this at least for the moment: a roundup of some of the interesting things going on in the Git world.

InfoQ: Git/Github Roundup: Ruby Books, Gems, Gitjour

Git Iterator

Another neat little Git-related tool. This one allows an arbitrary script to be run against every version of the software in the history. The example uses it to generate a simple code-size graph, but the possibilities are much bigger.

lixo.org :: Git Iterator

Source Control Mastery – The Daily WTF

We all love source control, right?

Source Control Mastery – The Daily WTF (recommended by Ernest Friedman-Hill)

I couldn’t live without it any more. So much so that the “gateway drugs” of CVS and Subversion are not enough any more. I keep being tempted to move on to stronger stuff, like Git and Bazaar …

Cleanly Migrate Your Subversion Repository To a GIT Repository

Regular readers (are there any?) should have guessed by now that I am investigating distributed version control (specifically git). I also have a significant investment of code and history in subversion repositories. A way to migrate from svn to git, keeping all the commit histories sounds great…

Simplistic Complexity » Cleanly Migrate Your Subversion Repository To a GIT Repository

Also An introduction to git-svn for Subversion/SVK users and deserters or Git Guides – Import from Subversion

Eclipse Git plugin installation

I found a blog entry which goes through the steps of downloading, building and installing the eclipse git plugin, so I thought I’d give it a go. It’s a bit complicated – involving building the plugin from source, but It seems to work!

Chris Cruft » Blog Archive » Eclipse Git plugin installation

Fun with Git

Recently I decided that it was time to stop just reading about distributed version control and give it a go. I had already run through a variety of git tutorials, but all of them concentrated on use of local repositories and/or starting with a clone of an existing remote repository.

My main need is something slightly different, though. I want to set up my own remote repositories for my large and rambling collection of projects, so that I can access them wherever and whenever I am working.

I was tempted to use Github but decided that the learning process of doing it myself would be valuable. Eventually, I think it was, but I still might go to Github for some of my projects.

My first step was to install Git on my main development machines. On the Ubuntu box it was easy using the Synaptic package manager. On a Windows box it’s not quite so straightforward, involving a choice between a Git based on Cygwin and a Git based on direct use of Windows libraries. I eventually chose the second option, but I might change my mind later if it doesn’t work out. For the moment it does the job.

My next step was to set up the remote repository. I decided to host my repositories on some space I rent from Dreamhost, as they seem generally pretty supportive of new stuff, and already include subversion hosting.

I started by following the steps in the DreamHost Wiki entry on Git, but could not make that work. Something went wrong at the step of pushing a local repository over WebDAV. Determined to continue, I instead tried the (somewhat more complex) steps at Autopragmatic » Blog Archive » Hosting a git repository on dreamhost. Even though this involved rebuilding a slightly non-standard version of Git on the server this now works very well.

I now have a small green-field project in a remote repository at Dreamhost. My next plan is to investigate using git-svn or some other form of git/subversion bridge.

Git tip: set your identification and colours

A small tip for setting some global configs for Git. Note that in my installation it needed a double dash (–global) instead of a single dash (-global).

lixo.org :: Git tip: set your identification and colours

The Web 2.0 Show – A podcast about the new web – Episode – Episode 45 – GitHub – Created by Josh Owens and Adam Stacoviak

I’m getting more and more interested in distributed version control, as exemplified by Git, Mercurial and Bazaar. I’m still intrigued by how well such approaches might fit with the other development tools that I use, but there’s certainly a lot of buzz around their advantages.

Recently I listened to a podcast from some American folks about GitHub, a new site offering a git-based hosting service for source code. Worth a listen if you can get past the massive overuse of the word “awesome”.

The Web 2.0 Show – A podcast about the new web – Episode – Episode 45 – GitHub – Created by Josh Owens and Adam Stacoviak

A tour of git: the basics

There has been an apparent upsurge in interest in distributed version control recently. I like the idea, although I am a little concerned with the relatively poor state of IDE integration for these tools compared with the more mainstream source repository systems such as subversion and CVS.

A tour of git: the basics