<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Julian Higman &#187; lava lamps</title>
	<atom:link href="http://julianhigman.com/blog/tag/lava-lamps/feed/" rel="self" type="application/rss+xml" />
	<link>http://julianhigman.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 21 Dec 2011 14:29:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CruiseControl is dead, long live Hudson</title>
		<link>http://julianhigman.com/blog/2009/01/21/cruisecontrol-is-dead-long-live-hudson/</link>
		<comments>http://julianhigman.com/blog/2009/01/21/cruisecontrol-is-dead-long-live-hudson/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 22:57:35 +0000</pubDate>
		<dc:creator>jhigman</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[cruise control]]></category>
		<category><![CDATA[hudson]]></category>
		<category><![CDATA[lava lamps]]></category>

		<guid isPermaLink="false">http://julianhigman.com/blog/?p=29</guid>
		<description><![CDATA[We&#8217;ve been using Cruise Control as our continuous integration system for ages, but problems with Subversion checkouts finally drove us to try Hudson as an alternative. It&#8217;s fantastic &#8211; configurable from the UI, it archives build logs as well as artifacts, it&#8217;s got console output in the browser, and so on. Why didn&#8217;t we switch [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been using <a href="http://cruisecontrol.sourceforge.net/" target="_blank">Cruise Control</a> as our continuous integration system for ages, but problems with Subversion checkouts finally drove us to try <a href="https://hudson.dev.java.net/" target="_blank">Hudson </a>as an alternative.</p>
<p>It&#8217;s fantastic &#8211; configurable from the UI, it archives build logs as well as artifacts, it&#8217;s got console output in the browser, and so on. Why didn&#8217;t we switch earlier?!</p>
<p>Anyhow, only slight modification need to make the lava lamps work with Hudson.</p>
<p>The lamps are controlled by an <a href="http://www.digidave.co.uk/jshop/product.php?xProd=211&amp;xSec=1&amp;jssCart=ca42637dbb60bed7e57dea7ece0ce85c" target="_blank">IP power switch</a>, with the 4 outlets turned on or off by hitting a url with some GET parameters (ok, it&#8217;s not RESTful, but come on..). A cron job fires invokes the script every minute with the &#8220;check&#8221; command to parse the RSS feed of latest build results from Hudson, and light the lights accordingly.</p>
<p>Cron also calls the &#8220;off&#8221; function after 5pm, to save the lamps from burning out overnight.</p>
<p>The script is something like this :</p>
<pre>#!/bin/bash
check() {</pre>
<pre>        # check Hudson on localhost and switch on lamps accordingly</pre>
<pre>        FAILCOUNT=`wget -O - -o wget.log http://localhost:8080/rssLatest | grep FAIL | wc -l`</pre>
<pre>        PASSCOUNT=`wget -O - -o wget.log http://localhost:8080/rssLatest | grep SUCCESS | wc -l`</pre>
<pre>        if [ $FAILCOUNT != 0 ]; then</pre>
<pre>                echo  `date` " : BUILD HAS FAILED"</pre>
<pre>                fail</pre>
<pre>        elif [ $PASSCOUNT != 0 ]; then</pre>
<pre>                echo  `date` " : BUILD IS OK"</pre>
<pre>                pass</pre>
<pre>       fi</pre>
<pre>}</pre>
<pre>pass() {</pre>
<pre>        # switch outlet 1 on and 3 off</pre>
<pre>        wget http://ip-switch.local/Set.cmd?CMD=SetPower+P60=1+P62=0 -q --delete-after</pre>
<pre>}</pre>
<pre>fail() {</pre>
<pre>        # switch outlet 3 on and 1 off</pre>
<pre>        wget http://ip-switch.local/Set.cmd?CMD=SetPower+P60=0+P62=1 -q --delete-after</pre>
<pre>}</pre>
<pre>off() {</pre>
<pre>        # switch them all off and go home</pre>
<pre>        wget http://ip-switch.local/Set.cmd?CMD=SetPower+P60=0+P62=0 -q --delete-after</pre>
<pre>}</pre>
<pre>exit</pre>
]]></content:encoded>
			<wfw:commentRss>http://julianhigman.com/blog/2009/01/21/cruisecontrol-is-dead-long-live-hudson/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

