Blog

Jenkins CI Server – Resetting a build number and cleaning a build

I’ve used a script to reset the build number during the migration to a new continuous integration server – namely Jenkins from Hudson.

The following script will remove all the workspace builds from Jenkins that exist, reset the build number for all projects specified
in the .hudson/jobs directory.

Use it with care. I take no responsibility for misuse of this or bugs etc…

On another note, there is a plugin available for Jenkins that allows you to change the build number, see: http://wiki.hudson-ci.org/display/HUDSON/Next+Build+Number+Plugin

 Bash |  copy |? 
#
# Hudson build cleaner
# Cleans out all builds for projects that exist in the directory
# Resets the build number to 1
# Backup all projects before running this
 
function cleanbuild {
 
  echo "cleaning $1"
  cd $1
  ls -l
  rm -Rf builds/*
  rm -Rf lastSuccesful
  rm -Rf lastStable/
  rm -Rf workspace/*
  rm -Rf modules/*
  rm -f lastSuccessful lastStable
  rm -f nextBuildNumber
  touch nextBuildNumber
  echo 1 >> nextBuildNumber
  cd -
}
 
for project in `find -L -maxdepth 1 -type d -name '*' ! -name '.*' -printf '%f\n' | column`
do
  cleanbuild $project
done

Installing and configuring ps3mediaserver

I was installing ps3mediaserver on Ubuntu 10.04 server tonight. It’s a Java based DNLA UPNP server that transcodes/streams on the fly – very handy for weird mkv file formats that the Playstation 3 doesn’t support natively. However, it didn’t prove to be the most straightforward of installs. Just a few tips here based on what ...

Migrating a WordPress Site to a new URL

Migrating a WordPress site to a different domain can be a bit of a pain. The standard way to do this is detailed in this tutorial on the wordpress website. If you’re using phpmyadmin to update the database directly the only two changes you have to make are to the site_url and home option-name‘s in ...

Hadoop setup in ten seconds flat

I needed to get Apache hadoop setup quickly on my local machine recently, I needed to hunt around for the correct ports which I found here: http://www.cloudera.com/blog/2009/08/hadoop-default-ports-quick-reference/ Installation involved downloading the hadoop distribution and creating the right configurations (core-site.xml, hdfs-site.xml and mapred-site.xml). It also involved formatting the namenode and starting everything up. It’s a pain ...

WordPress Permalinks Not Working Month and Name under Apache 2

When changing form the default permalink setting under WordPress you may encounter an error if mod_rewrite is not setup on Apache correctly. This results in a 404 page not found because Apache does not know how to route your requests properly. I found this when running WordPress with Apache2. In order to fix this you ...