piątek, czerwca 07, 2013

Skypt do niezależnego budowania war-a Grails

@echo off
::SET SCRIPT_NAME=%~n0
::SET TARGET_ENV=%SCRIPT_NAME:make_=%
SET TARGET_ENV=prod0
SET CANON_ENV=%TARGET_ENV:0=%
SET CANON_ENV=%CANON_ENV:1=%
SET CANON_ENV=%CANON_ENV:2=%
echo *** Downloading Grails framework
echo ***
wget -c http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.2.2.zip >NUL
echo *** Unzipping Grails distro
echo ***
unzip -n grails-2.2.2.zip >NUL
SET PREV_HOME=%GRAILS_HOME%
SET PREV_PATH=%GRAILS_HOME%\bin
SET GRAILS_HOME=%~dp0
SET GRAILS_HOME=%GRAILS_HOME%grails-2.2.2
CALL SET CLEANED_PATH=%%PATH:%PREV_PATH%=%%
set PATH="%GRAILS_HOME%\bin";%CLEANED_PATH%
SET PREV_HOME=
SET PREV_PATH=
SET CLEANED_PATH=
echo *** I will make WAR file for %TARGET_ENV% (%CANON_ENV%) using %GRAILS_HOME%
echo ***
copy grails-app\conf\Config.groovy.%TARGET_ENV% grails-app\conf\Config.groovy
start /b /wait grails %CANON_ENV% war
pause

0 komentarze: