2
0

feat: license服务端

This commit is contained in:
caiyuchao
2025-04-15 18:32:33 +08:00
parent 64da1b66d3
commit 4c42a7f969
6 changed files with 88 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ BERootDir=${GitRootDir}/be.wfc
FERootDir=${GitRootDir}/fe.wfc
FEUserRootDir=${GitRootDir}/fe.wfc.user
BuildRootDir=${GitRootDir}/build.wfc
LicenseRootDir=${GitRootDir}/license.wfc
WFCWorkDir=/opt/wfc
BuildDockerDir=${BuildRootDir}/build/docker
@@ -82,6 +83,8 @@ pre-git-pull(){
git pull
cd ${BuildRootDir}
git pull
cd ${LicenseRootDir}
git pull
}
pre-build-deb(){
@@ -111,6 +114,9 @@ build-jar(){
cd ${BERootDir}
# git pull
mvn clean package -Dmaven.test.skip=true -P prod
cd ${LicenseRootDir}
# git pull
mvn clean package -Dmaven.test.skip=true
}
pre-build-src-tar(){
@@ -123,6 +129,8 @@ pre-build-src-tar(){
clean-jar(){
cd ${BERootDir}
mvn clean
cd ${LicenseRootDir}
mvn clean
}
build-dist(){

View File

@@ -5,6 +5,7 @@ BERootDir=${GitRootDir}/be.wfc
FERootDir=${GitRootDir}/fe.wfc
FEUserRootDir=${GitRootDir}/fe.wfc.user
BuildRootDir=${GitRootDir}/build.wfc
LicenseRootDir=${GitRootDir}/license.wfc
I18nResourcesDir=${BERootDir}/wfc-common/wfc-common-core/src/main/resources
WFCWorkDir=/opt/wfc
@@ -87,3 +88,7 @@ echo "done"
echo -n "Begin copy wfc-modules-payment ... "
cp -rf ${BERootDir}/wfc-modules/wfc-payment/target/wfc-modules-payment.jar ${BuildDockerDir}/wfc/modules/payment/jar
echo "done"
echo -n "Begin copy wfc-license-server ... "
cp -rf ${LicenseRootDir}/target/wfc-license-server-1.0.0.jar ${BuildDockerDir}/license-server/jar
echo "done"

View File

@@ -0,0 +1,12 @@
version: '3.8'
services:
wfc-license-serve:
# 使用前面创建的Dockerfile构建的镜像
build: .
# 指定容器名(可选)
container_name: wfc-license-server
# 指定端口映射例如将容器的8080端口映射到主机的8080端口
ports:
- "8070:8070"
volumes:
- ./license:/opt/license

View File

@@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
LABEL org.wfc.image.authors="wfc@wfc.org"
# 挂载目录
VOLUME /opt/wfc
# 创建目录
RUN mkdir -p /opt/wfc
# 指定路径
WORKDIR /opt/wfc
# 复制jar文件到路径
COPY jar/wfc-license-server-1.0.0.jar /opt/wfc/wfc-license-server.jar
# 启动licese-serve服务
ENTRYPOINT ["java","-jar","wfc-license-server.jar"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -0,0 +1,47 @@
#!/bin/bash
WFCWorkDir=/opt/wfc
DockerDir=${WFCWorkDir}/docker/license-server
DockerCompose=docker-compose
PIDFile=/run/licensecontrol.pid
case "$1" in
start)
cd ${DockerDir}
if [ -z "$2" ]; then
${DockerCompose} up -d
echo $! > ${PIDFile}
else
${DockerCompose} up -d $2
fi
;;
stop)
cd ${DockerDir}
if [ -z "$2" ]; then
${DockerCompose} stop
if [ -f ${PIDFile} ]; then
rm ${PIDFile}
fi
else
${DockerCompose} stop $2
fi
;;
restart)
$0 stop $2
sleep 1
$0 start $2
;;
status)
cd ${DockerDir}
if [ -z "$2" ]; then
${DockerCompose} ps
else
${DockerCompose} ps $2
fi
;;
*)
echo "License Server Service ... "
echo "Usage: $0 start|stop|restart|status"
exit 1
;;
esac