Tuesday, February 15, 2011

How to prevent Hudson to kill processes

Normally hudson will kill all the processes that have been created during the build tasks, this will ensure that after the build the system will be left in a consistent state.

However, sometimes, you may need to keep those tasks running, for example we use Hudson to automatically perform nightly installations on our test servers, in those cases you want that hudson will not kill the processes that have been started during the installation (i.e. jboss, tomcat).

A web search got me this page:

http://www.suryasuravarapu.com/2010/07/spawning-a-process-from-hudson.html

The page explain how to setup the project to prevent hudson from killing started process, basically it says:

set the environment variable BUILD_ID to something like 'dontKillMe' in the
process that should stay alive.

Hudson looks for that environment variable when cleaning up stray processes.

However, if you are new to hudson, it does not say how to achieve that, well, you can use the setenv plugin, to install it you have to simply go to the “manage hudson” page where you will find the “manage plugins” shortcut, in the plugins page (in the “available” column) you can find the SetEnv plugin, just mark it and then click on “install” at the end of the page.

At the end of the plugin installation you can restart hudson and the Environment Variables field will appear when configuring the project.

 

Happy CI.

Monday, February 14, 2011

Hudson

Installing hudson is pretty easy, you can download the war from http://java.net/projects/hudson/downloads/directory/war, for example you can download it directly from the server:

wget http://java.net/projects/hudson/downloads/download/war%252Fhudson-1.395.war

Then you can create a script like this that will start it:

#!/bin/bash



 



dir=/home/polopoly/hudson<



 



nohup java -jar $dir/hudson.war --httpPort=18080 --ajp13Port=18009 >$dir/hudson.log 2>&1 &; 




 


this will start hudson on port 18080, the only remaining thing you have to configure is the email server that should be used to send email alert (if you want to send them which is highly recommended).


Now you are free to create your tasks.

Wednesday, February 09, 2011

CKEditor

I’ve just replaced the old FCKEditor with CKEditor, in this page you can find some really helpful hints to achieve better performance: http://ckeditor.com/blog/CKEditor_Loading_performance_details

As always, measure your performance to understand if the changes you have done are really worth it.