Вопрос

Background:

My team has been using Jenkins to run our continuous integration (CI) for our Grails applications. We are trying to move closer to Continuous Delivery by setting up a deployment pipeline and having push button deployments to multiple environments (Dev, Itg, Prod). We have tried to use the Jenkins Tomcat plugin to deploy our code but have run into occasional PermGen issues on Tomcat and have to manually restart it after the deployment.

Questions:

  1. Is Jenkins the right tool to use for automated deployments with Grails?
  2. How can we automate the deployment to Tomcat without having to manually restart it afterwords?
Это было полезно?

Решение

  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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top