Created
November 11, 2010 14:39
-
-
Save xlson/672577 to your computer and use it in GitHub Desktop.
Quick hack that makes it easier to use the tomcat plugins deploy feature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
includeTargets << grailsScript("Init") | |
def tomcatRedeploy(String environment) { | |
runTomcatTarget('undeploy', environment) | |
runTomcatTarget('deploy', environment) | |
} | |
def runTomcatTarget(String target, String environment) { | |
def proc = ['grails', "-Dgrails.env=$environment", 'tomcat', target].execute() | |
proc.consumeProcessOutput System.out, System.err | |
proc.waitFor() | |
} | |
target(main: "Do a redeploy using the tomcat plugin.") { | |
depends(parseArguments) | |
def env = argsMap.params ? argsMap.params[0] : 'stage' | |
tomcatRedeploy(env) | |
} | |
setDefaultTarget("main") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick hack that acts as an alias for
grails -Dgrails.env=$env tomcat undeploy && grails -Dgrails.env=$env tomcat deploy
. Instead you will be able to callgrails deploy
(deploy to stage) orgrails deploy env
(deploy to the chosen environment). Put the file into$PROJECT_DIR/scripts