From a25c27e8b49837503683adda0437b632f67703e1 Mon Sep 17 00:00:00 2001 From: Joakim Sundqvist Date: Fri, 13 Jan 2012 14:42:34 +0100 Subject: [PATCH] Added new redeploy task that makes it possible to upload a war file to a server that already has that one deployed without having to undeploy it first. --- scripts/Tomcat.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/Tomcat.groovy b/scripts/Tomcat.groovy index 3311e66..3d14f06 100644 --- a/scripts/Tomcat.groovy +++ b/scripts/Tomcat.groovy @@ -10,6 +10,7 @@ target(main: '''\ Script used to interact with remote Tomcat. The following subcommands are available: grails tomcat deploy - Deploy to a tomcat server +grails tomcat redeploy - Update/Deploy to a tomcat server grails tomcat undeploy - Undeploy from a tomcat server ''') { depends(parseArguments, compile,createConfig) @@ -19,16 +20,19 @@ grails tomcat undeploy - Undeploy from a tomcat server def user = config.tomcat.deploy.username ?: 'manager' def pass = config.tomcat.deploy.password ?: 'secret' def url = config.tomcat.deploy.url ?: 'http://localhost:8080/manager' + def update = (cmd == 'redeploy') switch(cmd) { case 'deploy': + case 'redeploy': war() println "Deploying application $serverContextPath to Tomcat" deploy(war:warName, url:url, path:serverContextPath, username:user, - password:pass) + password:pass, + update: update) break case 'list':