jenkins the definitive guide

(Jeff_L) #1

Jenkins provides excellent support for Grails builds. First, you need to install the Jenkins Grails plugin^12.
Once you have installed this and restarted Jenkins, you will need to provide at least one version of Grails
for Jenkins to use in the Grails Builder section of the Configure System screen (see Figure 5.49, “Adding
a Grails installation to Jenkins”).


Figure 5.49. Adding a Grails installation to Jenkins


Now you can set up a freestyle build job to build your Grails project. The Grails plugin adds the
“Build with Grails” build step, which you can use to build your Grails application (see Figure 5.50,
“Configuring a Grails build step”). Here, you provide the Grails target, or targets, you want to execute.
Unlike the command line, you can execute several targets in the same command. However, if you need
to pass any arguments to a particular target, you should enclose the target and its arguments in double
quotes. In Figure 5.50, “Configuring a Grails build step”, for example, we run grails clean, followed
by grails test-app -unit -non-interactive. To get this to work properly, we enclose the
options of the second command in quotes, which gives us grails clean "test-app -unit -
non-interactive".


(^12) http://wiki.jenkins-ci.org/display/HUDSON/Grails+Plugin

Free download pdf