[Deploying Sakai] Hudson in production instances

Raad Al-Rawi raad at caret.cam.ac.uk
Fri Apr 8 09:41:10 PDT 2011


Hi Miguel

We use Hudson for building Sakai, but not for actually deploying it - we 
do that via a custom script.
So I can give you some information but I don't have actual documentation 
to support this (although I probably will when I've finished writing this!)

So we have a box running Hudson (h-server) with maven 2.2.1, and java 
1.6; and a box running Sakai (s-server) with apache configured to hook 
into the Sakai tomcat via mod_jk.

On h-server we have a job/project configured to use JDK Java 6, pull the 
Sakai code out of our local svn repo, and "use update".

We execute a couple of (pre) build shell commands (add a build step) to 
clear out the workspace :

rm -rf /var/lib/hudson/jobs/sakai-2.7/workspace/tomcat
mkdir /var/lib/hudson/jobs/sakai-2.7/workspace/tomcat

and build using Maven 2.2.1 using the build command:

clean install sakai:deploy 
-Dmaven.tomcat.home=/var/lib/hudson/jobs/sakai-2.7/workspace/tomcat 
-Dmaven.test.skip=true

and JVM options:

-Xmx1024m -XX:MaxPermSize=400m

We then run a post-build script to tar up everything (add another build 
step):

#!/bin/bash
pushd /var/lib/hudson/jobs/sakai-2.7/workspace/tomcat
tar czf ../tomcat-2.7-new.tar.gz *
mv ../tomcat-2.7-new.tar.gz ../tomcat-2.7.tar.gz
popd
rm -rf /var/lib/hudson/jobs/sakai-2.7/workspace/tomcat

On s-server we have a clean copy of tomcat (5.5.30) in a set directory. 
We also have a script that essentially:

  - shuts down the sakai tomcat
  - downloads the tar file from h-server
  - backs up, then deletes the current sakai tomcat
  - copies the clean tomcat in place
  - expands the tar file over the new tomcat
  - fixes up the mysql connector, logging, sakai.properties
  - starts up the sakai tomcat

There are probably a few other small things that happen, but that's 
pretty much it.

I hope that helps - do ask if you need anything more.

Cheers

Raad

On 08-Apr-11 11:21, Miguel Carro Pellicer wrote:
> Hi all.
>
> Anybody has any documentation about deploying Sakai using Hudson? I'm
> working in a continous integration architecture with Sakai and hudson,
> if anyone has any documentation help will be appreciate.
>
> Thanks in advance, Miguel.
> --


More information about the production mailing list