-
Notifications
You must be signed in to change notification settings - Fork 429
/
build.cmd
106 lines (88 loc) · 3.07 KB
/
build.cmd
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
@echo off
@rem Check for mvn in path, use it if found, otherwise use maven wrapper
@set MAVEN_CMD=mvn
@set CURR_DIR=%cd%
@where /q mvn
@if "%1" == "" call:help
@if "%1" == "sso-server" call:sso-server
@if "%1" == "sso-management" call:sso-management
@if "%1" == "sso-config" call:sso-config %2 %3 %4
@if "%1" == "cas-client-demo" call:cas-client-demo %2 %3 %4
@if "%1" == "shiro-client-demo" call:shiro-client-demo %2 %3 %4
@if "%1" == "help" call:help
@if "%1" == "run" call:run-all
@if "%1" == "init" call:init
@rem function section starts here
@goto:eof
:help
@echo "Usage: build.bat [help|sso-server|sso-management|sso-config|cas-client-demo|shiro-client-demo|run-all|hosts]"
@echo 1. sso-config: Config Server
@echo 2. sso-server: CAS Server
@echo 3. sso-management: Cas Management
@echo 4. cas-client-demo: CasClient Demo
@echo 5. shiro-client-demo: ShiroDemo
@echo 6. run: Run all server
@echo 7. init: set '127.0.0.1 passport.sso.cm' to HOSTS, import cert to %JAVA_HOME%\jre\lib\security\cacerts
@goto:eof
:sso-server
@echo Stating sso server...
cd "%CURR_DIR%/sso-server"
start "sso-server" build.cmd run
cd "%CURR_DIR%"
@goto:eof
:sso-management
@echo Stating cas management...
cd "%CURR_DIR%/sso-management"
start "sso-management" build.cmd run
cd "%CURR_DIR%"
@goto:eof
:sso-config
@echo Stating config Server...
cd "%CURR_DIR%"
start "sso-config" %MAVEN_CMD% spring-boot:run -T 5 %1 %2 %3 -f sso-config/pom.xml
@goto:eof
:sso-monitor
@echo Stating monitor Server...
cd "%CURR_DIR%"
start "sso-monitor" %MAVEN_CMD% spring-boot:run -T 5 %1 %2 %3 -f sso-monitor/pom.xml
@goto:eof
:cas-client-demo
@echo Stating cas client demo...
cd "%CURR_DIR%"
start "cas-client-demo" %MAVEN_CMD% jetty:run -f sso-client-demo/sso-cas-client-demo/pom.xml
@goto:eof
:shiro-client-demo
@echo Stating shiro client demo...
cd "%CURR_DIR%"
start "shiro-client-demo" %MAVEN_CMD% spring-boot:run -T 5 %1 %2 %3 -f sso-client-demo/sso-client-shiro-demo/pom.xml
@goto:eof
:sso-client-proxy-demo
@echo Stating proxy client demo...
cd "%CURR_DIR%"
start "sso-client-proxy-demo" %MAVEN_CMD% spring-boot:run -T 5 %1 %2 %3 -f sso-client-demo/sso-client-proxy-demo/pom.xml
@goto:eof
::运行所有服务
:run-all
@echo Starting run all...
call %MAVEN_CMD% clean
call:sso-config
call:sso-monitor
call:sso-server
call:cas-client-demo
call:shiro-client-demo
call:sso-management
call:sso-client-proxy-demo
@echo All server have started.
@goto:eof
::导入证书到java环境、设置host
:init
echo init project...
call mvn clean install
@rem @echo setting hosts...
@rem @echo 127.0.0.1 passport.sso.com >>C:\WINDOWS\system32\drivers\etc\hosts
::if exist "tomcat.cer" (echo file exists delete... & del tomcat.cer)
::echo Enter password: "123456"
::keytool -exportcert -alias passport.sso.com -keystore "%CURR_DIR%/sso-server/src/main/resources/tomcat.keystore" -file tomcat.cer -rfc
::echo Enter password: "changeit" and next to Y
::keytool -import -alias passport.sso.com -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -file tomcat.cer -trustcacerts
@goto:eof