Continuous Delivery with Grails Continuous Delivery with Grails jenkins jenkins

Continuous Delivery with Grails


  1. I don't think anyone can say if Jenkins is the "right" tool, but it is a good one.
  2. When you hot-deploy to Tomcat, its PermGen will almost inevitably grow. A restart is the easiest way to handle this. See other questions like What makes hot deployment a "hard problem"? for more information. You can use the Post Build Task to run a shell script on the Jenkins server to deploys the war and restart Tomcat.


We use grails, tomcat, and elastic load balancers and have scripted instance startup / provisioning / deployment via AWS infrastructure. An S3 bucket contains our war file which is placed there by our Jenkins server as part of a plugin we configured. This is versioned by build number and Jenkins job name so we have one for each environment. A chef script pulls our dependencies and the war into the instance and does all the real work, while our Jenkins ran orchestration script loops and sleeps on each stage of success until new instances are fully up and passing load balancer health checks at which point we stop the old instances (the load balancers drain to the new ones). If anything fails or it times out we fail the Jenkins job after shutting down the new instances. In order to follow this approach we have no shared state in our application and we use memcached (elasticache) as our session store via grails spring security integration.


From my perspective (admittedly biased) Jenkins is not meant to perform deployments. Its not set up that way. To the extent that scissors are not meant to peel oranges, Jenkins is not the right tool to do deployments. But it will do the job regardless.