July 20, 2007

New BootStrap Script for Sakai and Maven 2

I have produced a new script for us folks fearful of Maven 2 and/or with a poor memory.

This is a bootstrap script. It only requires Unix (preferably Mac OS/X), Java and SVN - it does everything else including:

- Installing the right version of Maven
- Installing and setting up the right version of Tomcat
- Putting the demo sakai.properties into Tomcat
- Setting things like MAVEN_OPTS and JAVA_OPTS
- Telling you what to do to your .bash_login file to make live easier
- Wiping out the sakai bit of your Maven 2 repository to insure a clean slate
- Checking out the Sakai trunk (tags can be specified with a parameter)
- Compiling the Sakai trunk with Maven 2
- Deploying Sakai to the nice fresh tomcat
- Then it even starts the Tomcat

All with the fresh, new hip Maven 2.

Usage instructions

cd
mkdir dev (or any directory you like)
cd dev
sh m2-bootstrap.sh (or sh m2-bootstrap.sh 2>&1 | tee output )
Wait a long time....

Success looks like this:
Starting Tomcat ....
Using CATALINA_BASE: /Users/csev/dev/apache-tomcat-5.5.23
Using CATALINA_HOME: /Users/csev/dev/apache-tomcat-5.5.23
Using CATALINA_TMPDIR: /Users/csev/dev/apache-tomcat-5.5.23/temp
Using JRE_HOME: /System/Library/Frameworks/JavaVM.fram

Assuming no error messages - point your browser at http://localhost:8080/

This will make three sub-directories in the directory it is started from

apache-tomcat-5.5.23
keepzips (so it does not have to keep downloading fresh maven's and tomcats)
sakai
maven-2.0.7

It will only make the maven directory it it detects that you either (a) do not have maven 2 installed or (b) have a version less than 2.0.7 installed.

This is a variation of my sakai-bootstrap.sh script which does equivalent work in Maven 1. I attach both scripts in case you made your own derivative script - so you can do diffs.

My script is more complex than the commands needed to make it work - but I have lots of scenarios and checks for missing or badly configured stuff included in the script.

I use this script each time I want a fresh trunk or tag checkout - so I am 100% assured of a clean starting point.

Of course all my QA is on Mac OS/X - it should work on *nix variants as well - feel free to send me fixes if my bash-coding is less than portable.

All in all - it is pretty impressive what Ian and Alistair have done here - thanks a ton.

Attachments:


m2-bootstrap.sh


sakai-bootstrap.sh

Posted by csev at July 20, 2007 02:54 PM