Showing posts with label Hudson. Show all posts
Showing posts with label Hudson. Show all posts

Thursday, 17 December 2009

Deploying large war files to Tomcat under Hudson: use Cargo

Whilst
mvn tomcat:deploy
works for the majority of war files under Hudson, for a large war (34m) the deploy failed with Out of memory error, though not at the shell prompt. Failure to fix by tweeking memory arguments led me to use Cargo instead. Note that the local tomcat is treated as remote to reduce rework when deploying to a remote server.
<build>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<wait>true</wait>
<container>
<containerId>tomcat6x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.tomcat.manager.url>http://localhost:8080/manager</cargo.tomcat.manager.url>
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.password></cargo.remote.password>
</properties>
</configuration>
<deployer>
<type>remote</type>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<properties>
<context>${project.artifactId}</context>
</properties>
<type>war</type>
</deployable>
</deployables>
</deployer>
</configuration>
<executions>
<execution>
<id>do</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deployer-redeploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Wednesday, 11 November 2009

Setting up Hudson CI for GWT Development

Hudson CI for GWT Development (made with Gliffy)GWT development requires a 32 bit Sun JDK.

We decided to do this by using a 32 bit VM, which could be moved to another server at a later date.
  1. Install VMWare Player (Ensure networking is enabled during installation)
  2. Download a 32 bit ubuntu ISO (or 32 bit Debian)
  3. Create a new VM from the ISO.
  4. Enter VM and establish your ipaddress.
  5. Add hudson repo to /etc/apt/sources
    deb http://hudson.gotdns.com/debian binary/
    
  6. Install Sun JDK
    apt-get install sun-java6-jdk 
    update-alternatives --config java
    update-alternatives --config javac
  7. Install Tomcat
    apt-get install tomcat6
    apt-get install tomcat6-admin
    
    Modify /etc/tomcat/tomcat-users.xml and add
    <user username="admin" password="" roles="manager,admin"/>
    (or add a password and add password to ~/.m2/settings.xml)
    Set Tomcat security off
    sed -i "s/TOMCAT6_SECURITY=.\+/TOMCAT6_SECURITY=no/" \
    /etc/default/tomcat6
    
    Increase Tomcat default memory allocation in /etc/defaults/tomcat6
    JAVA_OPTS="-Djava.awt.headless=true -Xmx1024M -Xms1024m"
  8. Install Hudson
    apt-get install hudson
    
  9. Change Hudson port and ajpport by editting /etc/init.d/hudson to add
    HUDSON_ARGS="--httpPort=8081  --ajp13Port=8102" 
  10. Install Apache
    apt-get install apache2
    a2enmod proxy
    a2enmod proxy_http
  11. Setup /etc/apache2/httpd.conf (or similar)
  12. servername hudson
    ProxyPass   /  http://localhost:8081/
    ProxyPassReverse  /  http://localhost:8081/
    ProxyRequests   Off
    <Proxy http://localhost:8081/*>
    Order deny,allow
    Allow from all
    </Proxy>
  13. Install Maven
    apt-get install maven2
  14. Configure Hudson
    • setup smtp
    • set MAVEN_HOME to /usr/share/maven2
    • set email from address
    • set url to ip address
  15. Download GWT toolkit 1.7.1 and extract then install gwt-dev-linux.jar to your local repo
    mvn install:install-file \
    -DgroupId=com.google.gwt -DartifactId=gwt-dev \
    -Dversion=1.7.1 -Dclassifier=linux \
    -Dpackaging=jar -Dfile=gwt-dev-linux.jar
  16. Add individual projects to Hudson

Friday, 29 May 2009

You are using Continuous Integration, aren't you?

This is one of those questions expecting the answer yes, like you have lost your virginity, haven't you?, which has a motivational impact.

Another prod in the right direction was when someone used Hudson as the term for CI server, as you would use Hoover for vaccum cleaner.

I have tried three times to use Continuum, only once with any degree of success. Hudson just works, straight out of the box.

I am proud to say I am, at last and later than most, using Continuous Integration.