diff --git a/demos/scripts/build-javaapp.bat b/demos/scripts/build-javaapp.bat index 9dbbcfa..7fc4ca0 100644 --- a/demos/scripts/build-javaapp.bat +++ b/demos/scripts/build-javaapp.bat @@ -1,9 +1,11 @@ +@echo off rem ------------------------------------------------- -rem 本脚本用于编译打包 JavaWebApp -rem 环境要求:Maven + JDK8 +rem 本脚本用于编译打包 JavaWebApp +rem 环境要求:Maven + JDK8 rem ------------------------------------------------- -@echo off -cd "../javaapp" -mvn clean package -Dmaven.test.skip=true +pushd %~dp0..\javaapp +call mvn clean package -Dmaven.test.skip=true +popd + pause diff --git a/demos/scripts/build-reactapp.bat b/demos/scripts/build-reactapp.bat index 51199f8..d048d1e 100644 --- a/demos/scripts/build-reactapp.bat +++ b/demos/scripts/build-reactapp.bat @@ -1,12 +1,10 @@ +@echo off rem ------------------------------------------------- rem The script is use to package JavaWebApp rem Env: Nodejs 8.x rem ------------------------------------------------- -@echo off - -rem 删除 dist 目录 -cd ../reactapp +pushd %~dp0..\reactapp echo ">>>> 1. Delete node_modules" rd /s /q node_modules @@ -19,4 +17,6 @@ echo ">>>> 3. npm run prod" rem 构建生产环境,构建的静态资源文件在 dist 目录 call npm run prod +popd + pause diff --git a/demos/scripts/demo01-start.bat b/demos/scripts/demo01-start.bat index 406b59b..dbfbe7a 100644 --- a/demos/scripts/demo01-start.bat +++ b/demos/scripts/demo01-start.bat @@ -1,16 +1,20 @@ +@echo off rem ------------------------------------------------- rem 启动 Demo1 rem 1. 启动 Nginx rem 2. 启动一个 JavaApp,访问地址为:localhost:9010 rem ------------------------------------------------- -@echo off + echo ">>>> 1. Start nginx" -cd "../nginx-1.14.0" +pushd %~dp0..\nginx-1.14.0 call nginx-start.bat +popd echo ">>>> 2. Start javaapp - localhost:9010" -cd "../javaapp" -java -Dtomcat.connector.port=9010 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main +pushd %~dp0..\javaapp +call java -Dtomcat.connector.port=9010 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main +popd + pause diff --git a/demos/scripts/demo02-start.bat b/demos/scripts/demo02-start.bat index 7ab3519..1d10a16 100644 --- a/demos/scripts/demo02-start.bat +++ b/demos/scripts/demo02-start.bat @@ -1,3 +1,4 @@ +@echo off rem ----------------------------------------------------------------------------- rem Demo02 - 负载均衡配置(Nginx/demos/nginx-1.14.0/conf/demos/demo02.conf) rem 1. 启动 Nginx @@ -6,16 +7,19 @@ rem localhost:9021 rem localhost:9022 rem localhost:9023 rem ----------------------------------------------------------------------------- -@echo off + echo ">>>> 1. Start nginx" -cd "../nginx-1.14.0" +pushd %~dp0..\nginx-1.14.0 call nginx-start.bat +popd echo ">>>> 2. Start 3 java app: localhost:9021, localhost:9022, localhost:9023" -cd "../javaapp" +pushd %~dp0..\javaapp start /min java -Dtomcat.connector.port=9021 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main start /min java -Dtomcat.connector.port=9022 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main start /min java -Dtomcat.connector.port=9023 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main +popd + pause diff --git a/demos/scripts/demo03-start.bat b/demos/scripts/demo03-start.bat index 3c4208f..64ab495 100644 --- a/demos/scripts/demo03-start.bat +++ b/demos/scripts/demo03-start.bat @@ -1,3 +1,4 @@ +@echo off rem ----------------------------------------------------------------------------- rem Demo03 - 网站有多个 webapp 的配置(Nginx/demos/nginx-1.14.0/conf/demos/demo03.conf) rem 1. 启动 Nginx @@ -6,16 +7,18 @@ rem localhost:9030/ rem localhost:9031/product rem localhost:9032/user rem ----------------------------------------------------------------------------- -@echo off + echo ">>>> 1. Start nginx" -cd "../nginx-1.14.0" +pushd %~dp0..\nginx-1.14.0 call nginx-start.bat +popd echo ">>>> 2. Start 3 java app: localhost:9030, localhost:9031/product, localhost:9032/user" -cd "../javaapp" +pushd %~dp0..\javaapp start /min java -Dtomcat.connector.port=9030 -Dtomcat.context.path=/ -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main start /min java -Dtomcat.connector.port=9031 -Dtomcat.context.path=/product -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main start /min java -Dtomcat.connector.port=9032 -Dtomcat.context.path=/user -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main +popd + pause - diff --git a/demos/scripts/demo04-start.bat b/demos/scripts/demo04-start.bat index ab8d672..50d71cf 100644 --- a/demos/scripts/demo04-start.bat +++ b/demos/scripts/demo04-start.bat @@ -1,17 +1,20 @@ +@echo off rem ----------------------------------------------------------------------------- rem Demo04 - 动静分离 rem 1. 启动 Nginx rem 2. 启动一个 JavaApp,访问地址分别为: rem localhost:9040 rem ----------------------------------------------------------------------------- -@echo off + echo ">>>> 1. Start nginx" -cd "../nginx-1.14.0" +pushd %~dp0..\nginx-1.14.0 call nginx-start.bat +popd echo ">>>> 2. Start 3 java app: localhost:9040" -cd "../javaapp" +pushd %~dp0..\javaapp start /min java -Dtomcat.connector.port=9040 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main +popd pause diff --git a/demos/scripts/demo05-start.bat b/demos/scripts/demo05-start.bat new file mode 100644 index 0000000..7592f7d --- /dev/null +++ b/demos/scripts/demo05-start.bat @@ -0,0 +1,14 @@ +@echo off +rem ----------------------------------------------------------------------------- +rem Demo05 - 使用 Nginx 搭建文件服务器 +rem 1. 启动 Nginx +rem 2. 访问地址: +rem localhost:9050 +rem ----------------------------------------------------------------------------- + +echo ">>>> 1. Start nginx" +pushd %~dp0..\nginx-1.14.0 +call nginx-start.bat +popd + +