Warning: getimagesize(/home/benc/public_html/../../../../../../../../../../../../../../../../../../../../tmp/fb125.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/benc/public_html/wp-content/plugins/yet-another-photoblog/lib/YapbImage.class.php on line 438

Warning: getimagesize(/home/benc/public_html/../../../../../../../../../../../../../../../../../../../../tmp/pista.png) [function.getimagesize]: failed to open stream: No such file or directory in /home/benc/public_html/wp-content/plugins/yet-another-photoblog/lib/YapbImage.class.php on line 438

Warning: Cannot modify header information - headers already sent by (output started at /home/benc/public_html/wp-content/plugins/yet-another-photoblog/lib/YapbImage.class.php:438) in /home/benc/public_html/wp-includes/feed-rss2.php on line 8
Ben Cornwell http://www.bencornwell.com Sun, 06 Jul 2008 23:22:25 +0000 http://wordpress.org/?v=2.5.1 en Cleaning Up After CruiseControl http://www.bencornwell.com/2008/07/06/cleaning-up-after-cruisecontrol/ http://www.bencornwell.com/2008/07/06/cleaning-up-after-cruisecontrol/#comments Sun, 06 Jul 2008 23:22:25 +0000 ben_author http://www.bencornwell.com/?p=52 CI builds tend to generate a *lot* of output. With CruiseControl that’s no problem in itself, but you’ll probably want to purge old build artifacts periodically to avoid maxing out on disc usage.

Here’s a python script for cleaning up your artifacts dir. Posted by Phill (apparently doesn’t like to share his last name). Just put it somewhere sensible and slot into crontab.

#! /usr/bin/env python
# ==== Variables ====
ARTIFACTS_DIR="/opt/cruisecontrol/artifacts/"
NUM_BUILDS_TO_KEEP=10
# ==== End Variables ====

import os

def rm_recursive(path):
        """Removes a directory recursively"""

        for root, dirs, files in os.walk(path, topdown=False):
                for name in files:
                        os.remove(os.path.join(root, name))
                for name in dirs:
                        os.rmdir(os.path.join(root, name))
                #os.rmdir(path)

def delete_old_builds(path):
        """Deletes old builds"""

        builds = os.listdir(path)
        if len(builds) <= NUM_BUILDS_TO_KEEP:
                print "No builds to delete"
                return

        builds.sort()
        builds.reverse()

        i = 0

        for build in builds:
                i += 1
                if i <= NUM_BUILDS_TO_KEEP:
                        continue

                print "Deleting", build
                rm_recursive(os.path.join(path, build))

for file in os.listdir(ARTIFACTS_DIR):
        path = os.path.join(ARTIFACTS_DIR, file)

        if (os.path.isdir(path)):
                delete_old_builds(path)
]]>
http://www.bencornwell.com/2008/07/06/cleaning-up-after-cruisecontrol/feed/
CITCON http://www.bencornwell.com/2008/06/27/citcon-2/ http://www.bencornwell.com/2008/06/27/citcon-2/#comments Fri, 27 Jun 2008 13:28:07 +0000 ben_author http://www.bencornwell.com/?p=50 CITCON 2008 kicked off earlier this evening in Melbourne.

More to follow tomorrow!

]]>
http://www.bencornwell.com/2008/06/27/citcon-2/feed/
Fail http://www.bencornwell.com/2008/06/26/fail/ http://www.bencornwell.com/2008/06/26/fail/#comments Thu, 26 Jun 2008 09:49:19 +0000 ben_author http://www.bencornwell.com/?p=49 I’m not normally one to partake of stealing posts from other blogs, but this is just too good to resist. Lifted from FailBlog.org ]]>

I’m not normally one to partake of stealing posts from other blogs, but this is just too good to resist.

Lifted from FailBlog.org

]]>
http://www.bencornwell.com/2008/06/26/fail/feed/
PHPUnderControl (Install cont.) http://www.bencornwell.com/2008/06/25/phpundercontrol-install-cont/ http://www.bencornwell.com/2008/06/25/phpundercontrol-install-cont/#comments Wed, 25 Jun 2008 13:24:28 +0000 ben_author http://www.bencornwell.com/?p=48 In a previous post, I mentioned I would post the init script I’ve been using to start/stop CruiseControl. It’s not my own work (lifted from teh Internets). Looks like it was originally written by someone from ThoughWorks, but I didn’t find it on a ThoughWorks site & it didn’t come with a licence or copyright notice. Until I’m told otherwise, I guess it’s OK to redistribute.

Download it here

Obviously you’ll need to configure the script for your environment and allocate appropriate permissions. When you’re done, drop it into /etc/init.d/ and CruiseControl will automatically start during your server’s init routines. Also, when trying to stop the process, rather than scanning ps output trying to find the correct pid to kill, you just run:

# sudo /etc/init.d/cruisecontrol stop
]]>
http://www.bencornwell.com/2008/06/25/phpundercontrol-install-cont/feed/
PistaDex http://www.bencornwell.com/2008/06/24/pistadex/ http://www.bencornwell.com/2008/06/24/pistadex/#comments Tue, 24 Jun 2008 21:08:15 +0000 ben_author http://www.bencornwell.com/?p=47 pistadex.com

With official interest rates likely to increase by one billion percent in the second half of 2008, the RBA is advising potential pista-riders to get into the market while they can.

(previously: PistaDex)

]]>
http://www.bencornwell.com/2008/06/24/pistadex/feed/
PHPUnderControl Install Guide http://www.bencornwell.com/2008/06/22/phpundercontrol-install-guide/ http://www.bencornwell.com/2008/06/22/phpundercontrol-install-guide/#comments Sun, 22 Jun 2008 07:20:08 +0000 ben_author http://www.bencornwell.com/?p=46 Lately I’ve been doing some work with PHPUnderControl. It’s based on the Cruise Control Continuous Integration framework, which in turn, is based on Ant. It combines PHPUnit, PHPDocumentor & CodeSniffer to build & test software projects. It works pretty well, though there were a few mysteries along the way to getting an install up and running. I’m in the middle of preparing a comprehensive how-to, but meanwhile, here are a few notes I made about the installation & configuration process.

* There’s no easy way to start and stop Cruise Control. You’ll need to add an init script for starting/stopping/restarting. I’ll post mine here eventually.

* Disc Space: Builds can potentially use up a ton of the stuff. Make sure you have plenty of room, and/or, an easy way to shutdown the CC process if you find yourself running out of disc space.

* Configuration changes require a restart/reload to take affect. This should be second-nature if you’re used to configuring apache etc. Having said this, it caught me out a couple of times.

* You can configure builds to be triggered only where code changes have been merged to your svn sources. This saves heaps of unnecessary disc writing etc.

* Be careful using relative file paths. I’m still looking into how Ant handles file paths, but it definitely seems to be inconsistent. I’m using absolute paths in my build.xml & config.xml config files.

* If commands in your build process are failing, check the contents of /path/to/cruisecontrol/cruisecontrol.log - This will detail the exact commands being run by cruisecontrol.

* To test your build.xml configuration for a specific project run /path/to/cruisecontrol/apacheAnt-Version/bin/ant from within the project directory. Do this before restarting the cruisecontrol process to avoid builds failing because config errors.

]]>
http://www.bencornwell.com/2008/06/22/phpundercontrol-install-guide/feed/
Bianchi Pista http://www.bencornwell.com/2008/06/20/bianchi-pista-reparto-corsa/ http://www.bencornwell.com/2008/06/20/bianchi-pista-reparto-corsa/#comments Fri, 20 Jun 2008 12:18:57 +0000 ben_author http://www.bencornwell.com/?p=45 I’m building a bike! Bought a frame through Ebay last week which should be arriving any day now. More pics from the build will turn up here. ]]>

I’m building a bike! Bought a frame through Ebay last week which should be arriving any day now. More pics from the build will turn up here.

]]>
http://www.bencornwell.com/2008/06/20/bianchi-pista-reparto-corsa/feed/
Eastlink (plus to & from) http://www.bencornwell.com/2008/06/11/eastlink-plus-to-from/ http://www.bencornwell.com/2008/06/11/eastlink-plus-to-from/#comments Wed, 11 Jun 2008 09:41:58 +0000 ben_author http://www.bencornwell.com/2008/06/11/eastlink-plus-to-from/ This Sunday should be fun!

]]>
http://www.bencornwell.com/2008/06/11/eastlink-plus-to-from/feed/
Velo-Rage http://www.bencornwell.com/2008/06/08/velo-rage/ http://www.bencornwell.com/2008/06/08/velo-rage/#comments Sun, 08 Jun 2008 10:29:11 +0000 ben_author http://www.bencornwell.com/2008/06/08/velo-rage/

]]>
http://www.bencornwell.com/2008/06/08/velo-rage/feed/
On Cycling http://www.bencornwell.com/2008/06/06/on-cycling/ http://www.bencornwell.com/2008/06/06/on-cycling/#comments Fri, 06 Jun 2008 11:48:17 +0000 ben_author http://www.bencornwell.com/2008/06/06/on-cycling/ Fat Cyclist:

“Everyone talks about their hobbies and what they do for fun. Cycling, though, is much more than a hobby for me. It’s a giant reset button. I can be having the worst day ever; after ninety minutes on a bike, I’ve got my balance back.”


My problems are trivial compared to what this bloke & his family are coping with, but this is a sentiment shared.

]]>
http://www.bencornwell.com/2008/06/06/on-cycling/feed/