🔖 添加更新脚本

pull/2/head
Zhang Peng 2018-10-12 18:31:56 +08:00
parent adbcf81bc2
commit e6e27404a2
7 changed files with 53 additions and 23 deletions

View File

@ -1,9 +1,11 @@
@echo off
rem ------------------------------------------------- rem -------------------------------------------------
rem 本脚本用于编译打包 JavaWebApp rem 本脚本用于编译打包 JavaWebApp
rem 环境要求Maven + JDK8 rem 环境要求Maven + JDK8
rem ------------------------------------------------- rem -------------------------------------------------
@echo off pushd %~dp0..\javaapp
cd "../javaapp" call mvn clean package -Dmaven.test.skip=true
mvn clean package -Dmaven.test.skip=true popd
pause pause

View File

@ -1,12 +1,10 @@
@echo off
rem ------------------------------------------------- rem -------------------------------------------------
rem The script is use to package JavaWebApp rem The script is use to package JavaWebApp
rem Env: Nodejs 8.x rem Env: Nodejs 8.x
rem ------------------------------------------------- rem -------------------------------------------------
@echo off pushd %~dp0..\reactapp
rem 删除 dist 目录
cd ../reactapp
echo ">>>> 1. Delete node_modules" echo ">>>> 1. Delete node_modules"
rd /s /q node_modules rd /s /q node_modules
@ -19,4 +17,6 @@ echo ">>>> 3. npm run prod"
rem 构建生产环境,构建的静态资源文件在 dist 目录 rem 构建生产环境,构建的静态资源文件在 dist 目录
call npm run prod call npm run prod
popd
pause pause

View File

@ -1,16 +1,20 @@
@echo off
rem ------------------------------------------------- rem -------------------------------------------------
rem 启动 Demo1 rem 启动 Demo1
rem 1. 启动 Nginx rem 1. 启动 Nginx
rem 2. 启动一个 JavaApp访问地址为localhost:9010 rem 2. 启动一个 JavaApp访问地址为localhost:9010
rem ------------------------------------------------- rem -------------------------------------------------
@echo off
echo ">>>> 1. Start nginx" echo ">>>> 1. Start nginx"
cd "../nginx-1.14.0" pushd %~dp0..\nginx-1.14.0
call nginx-start.bat call nginx-start.bat
popd
echo ">>>> 2. Start javaapp - localhost:9010" echo ">>>> 2. Start javaapp - localhost:9010"
cd "../javaapp" pushd %~dp0..\javaapp
java -Dtomcat.connector.port=9010 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main call java -Dtomcat.connector.port=9010 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main
popd
pause pause

View File

@ -1,3 +1,4 @@
@echo off
rem ----------------------------------------------------------------------------- rem -----------------------------------------------------------------------------
rem Demo02 - 负载均衡配置Nginx/demos/nginx-1.14.0/conf/demos/demo02.conf rem Demo02 - 负载均衡配置Nginx/demos/nginx-1.14.0/conf/demos/demo02.conf
rem 1. 启动 Nginx rem 1. 启动 Nginx
@ -6,16 +7,19 @@ rem localhost:9021
rem localhost:9022 rem localhost:9022
rem localhost:9023 rem localhost:9023
rem ----------------------------------------------------------------------------- rem -----------------------------------------------------------------------------
@echo off
echo ">>>> 1. Start nginx" echo ">>>> 1. Start nginx"
cd "../nginx-1.14.0" pushd %~dp0..\nginx-1.14.0
call nginx-start.bat call nginx-start.bat
popd
echo ">>>> 2. Start 3 java app: localhost:9021, localhost:9022, localhost:9023" 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=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=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 start /min java -Dtomcat.connector.port=9023 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main
popd
pause pause

View File

@ -1,3 +1,4 @@
@echo off
rem ----------------------------------------------------------------------------- rem -----------------------------------------------------------------------------
rem Demo03 - 网站有多个 webapp 的配置Nginx/demos/nginx-1.14.0/conf/demos/demo03.conf rem Demo03 - 网站有多个 webapp 的配置Nginx/demos/nginx-1.14.0/conf/demos/demo03.conf
rem 1. 启动 Nginx rem 1. 启动 Nginx
@ -6,16 +7,18 @@ rem localhost:9030/
rem localhost:9031/product rem localhost:9031/product
rem localhost:9032/user rem localhost:9032/user
rem ----------------------------------------------------------------------------- rem -----------------------------------------------------------------------------
@echo off
echo ">>>> 1. Start nginx" echo ">>>> 1. Start nginx"
cd "../nginx-1.14.0" pushd %~dp0..\nginx-1.14.0
call nginx-start.bat call nginx-start.bat
popd
echo ">>>> 2. Start 3 java app: localhost:9030, localhost:9031/product, localhost:9032/user" 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=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=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 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 pause

View File

@ -1,17 +1,20 @@
@echo off
rem ----------------------------------------------------------------------------- rem -----------------------------------------------------------------------------
rem Demo04 - 动静分离 rem Demo04 - 动静分离
rem 1. 启动 Nginx rem 1. 启动 Nginx
rem 2. 启动一个 JavaApp访问地址分别为 rem 2. 启动一个 JavaApp访问地址分别为
rem localhost:9040 rem localhost:9040
rem ----------------------------------------------------------------------------- rem -----------------------------------------------------------------------------
@echo off
echo ">>>> 1. Start nginx" echo ">>>> 1. Start nginx"
cd "../nginx-1.14.0" pushd %~dp0..\nginx-1.14.0
call nginx-start.bat call nginx-start.bat
popd
echo ">>>> 2. Start 3 java app: localhost:9040" 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 start /min java -Dtomcat.connector.port=9040 -cp "target/JavaWebApp/WEB-INF/classes;target/JavaWebApp/WEB-INF/lib/*" io.github.dunwu.Main
popd
pause pause

View File

@ -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