-
Notifications
You must be signed in to change notification settings - Fork 45
/
launch.bat
54 lines (41 loc) · 1.35 KB
/
launch.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
@echo off
set mavenInput="%*"
if "%*" == "" (
echo No Maven arguments skipping maven build
) else (
echo Running with user input: %mavenInput%
echo Running maven build on available project
call mvn -v >con
cd ..
for %%s in ("-model" "-kjar" "business-application-service") do (
cd *%%s
echo ===============================================================================
for %%I in (.) do echo %%~nxI
echo ===============================================================================
if exist "%M3_HOME%\bin\mvn.bat" (
call %M3_HOME%\bin\mvn.bat %* >con
) else (
call mvn %* >con
)
cd ..
)
)
goto :startapp
:startapp
if not x%mavenInput:docker=%==x%mavenInput% (
echo Launching the application as docker container...
call docker run -d -p 8090:8090 --name business-application-service apps/business-application-service:1.0-SNAPSHOT
) else if not x%mavenInput:openshift=%==x%mavenInput% (
echo Launching the application on OpenShift...
call oc new-app business-application-service:1.0-SNAPSHOT
call oc expose svc/business-application-service
) else (
echo "Launching the application locally..."
setlocal EnableDelayedExpansion
cd business-application-service
cd target
for /f "delims=" %%x in ('dir /od /b *.jar') do set latestjar=%%x
cd ..
call java -jar target\!latestjar!
)
:end