Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add Grails to my cloudbees Jenkins installation?

I'm trying to follow the instructions here to run my Grails build on the Cloudbees' Jenkins service:

http://wiki.cloudbees.com/bin/view/DEV/Build+and+Deploy+Grails+application

However, when I try to select a Grails installation for my build job from the "Grails Installation", the drop-down list is empty except for the "Default" option:

enter image description here

When I run my build I get the following error message as though there are no Grials instances installed:

java.io.IOException: Cannot run program "grails" (in directory "/scratch/jenkins/workspace/liza"): java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:709)
    at hudson.Launcher$ProcStarter.start(Launcher.java:338)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:934)
    at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:901)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:326)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
    at java.lang.ProcessImpl.start(ProcessImpl.java:65)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    ... 15 more

Am I doing something wrong? Do I need to install Grails myself somehow?

I've tried checking the "Use Grails wrapper" checkbox but I still get a similar issue:

[liza] $ /scratch/jenkins/workspace/liza/grailsw upgrade --non-interactive
FATAL: command execution failed
java.io.IOException: Cannot run program "/scratch/jenkins/workspace/liza/grailsw" (in directory "/scratch/jenkins/workspace/liza"): java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
like image 559
Ricardo Gladwell Avatar asked Feb 06 '13 10:02

Ricardo Gladwell


2 Answers

"Use Grails wrapper" will help you here (assuming you're using Grails 2.1 or later). In your app run

grails wrapper

This will create a grailsw shell script and a few other bits and pieces in your app which you need to check in. This wrapper script can be used in place of an installed grails and it will download its own copy of Grails the first time it is run. If you tell Jenkins to "use grails wrapper" then it will not require a separate installation of Grails on the build server.

like image 198
Ian Roberts Avatar answered Nov 06 '22 03:11

Ian Roberts


If you go to /configure on your Jenkins server you should see a list of Grails installations. If it is empty, you can add one; select Use Pre-Installed Grails on DEV@Cloud and pick one of the offered versions if they suit your needs; or you can select Install automatically and get a recent build downloaded from a public mirror.

If these things do not work out, you can always open a support ticket; reference this SO question in case there is a resolution that can help others.

like image 24
Jesse Glick Avatar answered Nov 06 '22 01:11

Jesse Glick