-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.bat
82 lines (58 loc) · 1.7 KB
/
setup.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@echo off
rem ---------------------------------------------------------------------------
rem Setup processing for
rem
rem Environment Variable Prequisites
rem
rem JAVA_HOME Directory of Java Version
rem
rem
rem $Id: setup.bat,v 1.1 2008/11/13 16:23:07 mohanar Exp $
rem ---------------------------------------------------------------------------
setlocal
rem This looks weird but something causes value of %~dp0 to change later on.
set ORIGIN=%~dp0
if "%1"=="" goto :usage
if "%2"=="" goto :usage
if "%3"=="" goto :usage
:continue
echo SETIING UP PIPELINE UTILITIES
echo Using JAVA_HOME: %JAVA_HOME%
echo .
echo Verify java version (with 'java -version')
call java -version
set ADMIN_EMAIL=%1
shift
set SMTP_SERVER=%1
shift
set XNAT_URL=%1
shift
set XNAT_SITE_NAME=XNAT
if "%1"=="" goto :setDefaultSiteName
set XNAT_SITE_NAME=%1
shift
if "%1"=="" goto :EXECUTE
set DESTINATION=-Pdestination="%1"
shift
if "%1"=="" goto :EXECUTE
:DoWhileModulePaths
if not "%PATHS%"=="" set PATHS=%PATHS%,
set PATHS=%PATHS%%1
shift
if "%1"=="" goto :BreakOnModulePaths
goto :DoWhileModulePaths
:BreakOnModulePaths
set MODULE_PATHS="-PmodulePaths=%PATHS%"
goto :EXECUTE
:setDefaultSiteName
set XNAT_SITE_NAME=XNAT
:EXECUTE
rem Execute Gradle build
cd %ORIGIN%
gradlew -PadminEmail="%ADMIN_EMAIL%" -PsmtpServer="%SMTP_SERVER%" -PxnatUrl="%XNAT_URL%" -PsiteName="%XNAT_SITE_NAME%" %DESTINATION% %MODULE_PATHS%
goto :END
:USAGE
echo Missing required command line arguments
echo USAGE: setup.bat ^<admin email^> ^<SMTP server^> ^<XNAT url^> [XNAT site name] [destination] [modulePath1 modulePath2 modulePath3... modulePathn]
:END
endlocal