-
Notifications
You must be signed in to change notification settings - Fork 144
/
Copy pathbuild.bat
78 lines (66 loc) · 1.86 KB
/
build.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
@echo off
rem A batch script to build -> deploy -> restart
rem -- Laurence Geng
if [%1]==[] (
echo.
echo Usage: %0 [-delta] maven-profile-1 maven-profile-2 ...
echo.
echo Option: -delta: only deploy modified part, i.e. project artifact, used for development deploy.
goto end
)
set deltaDeploy=0
if "%~1"=="-delta" (
set deltaDeploy=1
shift
)
set profiles=%~1
:loopProfiles
shift
if "%~1"=="" (
goto build
) else (
set profiles=%profiles%,%~1
goto loopProfiles
)
:build
echo.
echo ***************************************************************************************
echo BUILD...
echo ***************************************************************************************
echo.
rem for 'prd' env, skip deploy! 'prd' is always deployed manually!
if "%profiles%"=="" (
cd ..\bdp-master-client
call mvn clean install -DskipTests=true
cd ..\bdp-stream
call mvn clean install -DskipTests=true
) else (
cd ..\bdp-master-client
call mvn clean install -DskipTests=true -P%profiles%
cd ..\bdp-stream
call mvn clean install -DskipTests=true -P%profiles%
)
if "%errorlevel%"=="1" goto :buildfailed
rem for 'prd' env, skip deploy! 'prd' is always deployed manually!
if "%profiles%"=="prd" goto "buildsuccess"
if "%deltaDeploy%"=="1" (
call target\classes\deploy.bat -delta
) else (
call target\classes\deploy.bat
)
goto buildsuccess
:buildsuccess
echo.
echo.
echo ***************************************************************************************
echo BUILD SUCCESS!!
echo ***************************************************************************************
goto end
:buildfailed
echo.
echo.
echo ***************************************************************************************
echo BUILD FAILED!!
echo ***************************************************************************************
goto end
:end