add Win boot script

This commit is contained in:
zhongjie
2021-06-15 11:26:48 +08:00
parent 57ffa9d351
commit 1ec59d51fc
6 changed files with 78 additions and 3 deletions

View File

@@ -51,8 +51,10 @@ jobs:
mkdir fizz-gateway-community
cp ./fizz-bootstrap/target/fizz-bootstrap-*.jar ./fizz-gateway-community/fizz-gateway-community.jar
cp ./fizz-bootstrap/target/classes/application.yml ./fizz-gateway-community/application.yml
cp ./fizz-bootstrap/target/classes/bootstrap.yml ./fizz-gateway-community/bootstrap.yml
cp ./fizz-bootstrap/target/classes/log4j2-spring.xml ./fizz-gateway-community/log4j2-spring.xml
cp ./fizz-bootstrap/sh/boot.sh ./fizz-gateway-community/boot.sh
cp ./fizz-bootstrap/sh/boot.cmd ./fizz-gateway-community/boot.cmd
zip -r ./fizz-gateway-community-${{ steps.releaseVersion.outputs.substring }}.zip ./fizz-gateway-community/*
- name: Release
uses: softprops/action-gh-release@v1

View File

@@ -176,7 +176,8 @@ Installation method 1: binary package:
1. Download the latest binary package of fizz-gateway-community and upzip to a directory, modify the configuration of the configuration center, registry, and redis in the application.yml configuration file (redis configuration needs to be consistent with the management backend).
2. Modify the apollo connection and JVM memory configuration of the boot.sh script
3. Execute `./boot.sh start` command to start the service, support start/stop/restart/status command
3. Linux startup Execute `./boot.sh start` command to start the service, support start/stop/restart/status command
4. Windows startup Execute `.\boot.cmd start` command to start the service, support start/stop/restart/status command
Installation method 2: source code:

View File

@@ -174,7 +174,8 @@ docker run --rm -d -p 8000:8000 \
1. 下载fizz-gateway-community的二进制安装包解压修改application.yml配置文件里配置中心、注册中心、redis(redis配置需与管理后台一致)的配置
2. 根据需要修改boot.sh脚本的apollo连接不使用apollo配置中心可跳过
3. 执行 `./boot.sh start` 命令启动服务,支持 start/stop/restart/status命令
3. Linux启动 执行 `./boot.sh start` 命令启动服务,支持 start/stop/restart/status命令
4. Windows启动 执行`.\boot.cmd start` 命令启动服务,支持 start/stop/restart/status命令
安装方式二:源码安装:

View File

@@ -87,11 +87,13 @@
<resource>
<directory>sh</directory>
<include>boot.sh</include>
<include>boot.cmd</include>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<include>application.yml</include>
<include>bootstrap.yml</include>
<include>log4j2-spring.xml</include>
<filtering>true</filtering>
</resource>

View File

@@ -0,0 +1,69 @@
@echo off
if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment. & EXIT /B 1
setlocal enabledelayedexpansion
set BASE_DIR=%~dp0
set APOLLO_META_SERVER=http://localhost:66
set APOLLO_ENV=prod
set SPRING_PROFILES_ACTIVE=prod
set APP_NAME=fizz-gateway-community
set APP_NAME_JAR=%APP_NAME%.jar
set APP_DEP_DIR=%BASE_DIR%
set APP_LOG_DIR=%APP_DEP_DIR%logs
set JAVA_CMD="%JAVA_HOME%\bin\java.exe"
IF NOT EXIST "%APP_LOG_DIR%" (
MKDIR "%APP_LOG_DIR%"
)
if "%1" == "stop" goto stop
if "%1" == "status" goto status
if not "%1" == "start" if not "%1" == "restart" (
echo "Usage: %0 {start|stop|restart|status}"
goto end
)
rem JVM CONFIG
set MEM_OPTS=-Xms256m -Xmx4096m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m
set JAVA_OPTS=%MEM_OPTS% -XX:+AggressiveOpts -XX:+UseBiasedLocking -XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -Xloggc:"%APP_LOG_DIR%\%START_DATE_TIME%.gc" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%APP_LOG_DIR%\dump.logs" -Dreactor.netty.pool.maxIdleTime=120000 -Dorg.jboss.netty.epollBugWorkaround=true
if "%1" == "start" goto start
if "%1" == "restart" goto stop
:status
for /f "tokens=1" %%i in ('jps -m ^| find /I "%APP_NAME%"') do (
echo "%APP_NAME_JAR% is runing"
goto end
)
echo "%APP_NAME_JAR% is not runing"
goto end
:stop
for /f "tokens=1" %%i in ('jps -m ^| find /I "%APP_NAME%"') do (
goto doStop
)
echo "WARN:%APP_NAME_JAR% is not runing"
if "%1" == "restart" goto start
goto end
:doStop
echo "Stoping %APP_NAME_JAR%..."
for /f "tokens=1" %%i in ('jps -m ^| find "%APP_NAME%"') do ( taskkill /F /PID %%i )
if "%1" == "restart" goto start
goto end
:start
for /f "tokens=1" %%i in ('jps -m ^| find /I "%APP_NAME%"') do (
echo "WARN:%APP_NAME_JAR% already started! Ignoring startup request."
goto end
)
echo "Starting %APP_NAME_JAR% ..."
%JAVA_CMD% %JAVA_OPTS% -Dfile.encoding=UTF-8 -Dspring.profiles.active=%SPRING_PROFILES_ACTIVE% -Denv=%APOLLO_ENV% -Dapollo.meta=%APOLLO_META_SERVER% -Dlogging.config=log4j2-spring.xml -jar "%APP_DEP_DIR%%APP_NAME_JAR%"
goto end
:end

View File

@@ -57,7 +57,7 @@ aggregate:
# need replace
password: 123456 #please input the redis password (default:123456)
# need replace
database: 10 #please input the redis database (default:9)
database: 9 #please input the redis database (default:9)
proxy-webclient:
name: proxy
aggr-webclient: