本地Windows打包启动前端后台
1、安装jdk
Windows JDK安装
2、Nginx
2.1、将 nginx-1.16.1文件夹复制到D:\home\jisapp目录下
2.2、域名证书配置:
将域名证书放到D:\home\jisapp\ssl\2023目录下->配置nginx.conf文件(D:\home\jisapp\nginx-1.22.0\conf目录下)
3、Nacos配置启动
3.1、将nacos文件夹复制到D:\home\jisapp目录下
3.2、在D:\home\jisapp\nacos\bin目录下找到start.cmd,点击运行即可
4、Redis配置启动
Redis在windows本地的安装配置
5、命令打包启动
5.1 前端打包
点击build-ui.bat运行即是打包,打包的路径在D:\project\code\webedi-front-end\dist
build-ui.bat内容即打包命令如下:
@echo off
title build-ui
echo.
echo build-ui
echo.
d:
cd D:\project\code\webedi-front-end
npm install --registry=https://registry.npmmirror.com
echo " ____ __ __";
echo " / __ \/ //_/";
echo " / / / / ,< ";
echo "/ /_/ / /| | ";
echo "\____/_/ |_| ";
echo " ";
echo cq-package-all-end
pause
5.2 前端启动
将打包好的dist文件夹复制到nginx对应目录下,例如:D:\project\nginx-1.16.1\html
nginx配置
nginx启动命令:start-nginx.bat
@echo off
title start nginx
echo.
echo start nginx
echo.
d:
cd D:\project\nginx-1.16.1
cmd /c "start nginx.exe"
timeout /t 3 /nobreak
访问地址:http://127.0.0.1:9009/login
说明:地址和端口根据本地相应配置来的
5.3 后台打包
package-all.bat
@echo off
title package-all
echo.
echo cq-package-all
echo.
echo.
echo ---------------------------input your env---------------------------
echo ---------------------------input your env---------------------------
echo.
ECHO.
ECHO. [dev] dev
ECHO. [test] test
ECHO. [uat] uat
ECHO. [prod] prod
ECHO. [exit] exit
ECHO.
ECHO.please input your env:
set /p ID=
IF "%id%"=="dev" GOTO dev
IF "%id%"=="test" GOTO test
IF "%id%"=="uat" GOTO uat
IF "%id%"=="prod" GOTO prod
IF "%id%"=="5" EXIT
PAUSE
:dev
SET "env= -P dev"
goto:run
:test
SET "env= -P test"
goto:run
:uat
SET "env= -P uat"
goto:run
:prod
SET "env= -P prod"
goto:run
:run
set folderPath=D:\project\code
d:
cd %folderPath%\common-spring-cloud-starter
call mvn clean install %env% -Dmaven.test.skip=true
cd %folderPath%\webedi-md-core
call mvn clean install %env% -Dmaven.test.skip=true
cd %folderPath%\webedi-gateway
call mvn clean install %env% -Dmaven.test.skip=true
cd %folderPath%\webedi-system
call mvn clean install %env% -Dmaven.test.skip=true
cd %folderPath%\webedi-sf
call mvn clean install %env% -Dmaven.test.skip=true
cd %folderPath%\webedi-po
call mvn clean install %env% -Dmaven.test.skip=true
echo " ____ __ __";
echo " / __ \/ //_/";
echo " / / / / ,< ";
echo "/ /_/ / /| | ";
echo "\____/_/ |_| ";
echo " ";
echo cq-package-all-end
pause
5.4 后台启动
run-gateway.bat
@echo off
title gateway
echo.
echo gateway
echo.
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
d:
cd D:\project\code\webedi-gateway\target
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar gateway.jar
echo " ____ __ __";
echo " / __ \/ //_/";
echo " / / / / ,< ";
echo "/ /_/ / /| | ";
echo "\____/_/ |_| ";
echo " ";
echo gateway-end
pause
ok,搞定!!!!!