Search code examples
grailscontinuous-integrationhudsonjenkinstomcat6

Continuous Integration with Grails


What tool would you recommend for continuous integration in a Grails + Tomcat (+ Ubuntu) environment? Jenkins? Hudson? Something else? I'm not looking for anything complex... simple would do just fine.


Solution

  • I just configured a grails job in Jenkins (running on debian). I cannot really say something about other CI servers.. I also know apache continuum but didn't use it for years.

    For Debian/Ubuntu you can simply add

    deb http://pkg.jenkins-ci.org/debian binary/
    

    in your /etc/apt/sources.list and then install jenkins via apt-get update && apt-get install jenkins

    A user jenkins is created.

    You might want to change the default configuration in /etc/default/jenkins for using another prefix (i.e. set it to jenkins so url will be something like http://localhost:port/jenkins) port or JENKINS_HOME.

    Per default jenkins home is /var/lib/jenkins.

    You can start/stop/restart jenkins via init.d script (i.e. /etc/init.d/jenkins restart).

    Inside jenkins you can then install the "Jenkins Grails Plugin" and add a new "free-style software project" and then inside its configuration (section build) do "Add build step->Build with Grails".

    Then for "targets" you can enter something like "clean test-app -unit" (add goals as it fits).

    For "Publishing Junit result reports" use a path like YOUR_PROJECT/target/test-reports/TESTS-TestSuites.xml

    Also don't forget to install the "Chuck Norris Plugins" for Jenkins... it's the most important plugin ever!

    If you also want to use apache2+Jenkins include something like this in your apache site configuration:

    Include /etc/jenkins/apache2.conf
    

    And create the file /etc/jenkins/apache2.conf with the following content:

    ProxyPass /jenkins http://localhost:8080/jenkins
    ProxyPassReverse /jenkins http://localhost:8080/jenkins
    ProxyPassReverse /jenkins http://example.org/jenkins
    ProxyPreserveHost On
    ProxyRequests Off
    ProxyPassReverseCookiePath /jenkins /jenkins
    <Proxy http://localhost:8080/jenkins*>
    Order deny,allow
    Allow from all
    </Proxy>
    

    You have to activate the proxy module:

    a2enmod proxy proxy_http
    

    and then restart apache2:

    /etc/init.d/apache2 restart