Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
291c25aa
提交
291c25aa
编写于
3月 22, 2022
作者:
sq3536
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
1018ee3c
d720616b
变更
13
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
195 行增加
和
9 行删除
+195
-9
config.xml
config.xml
+3
-5
Dockerfile
ibzdst-app/ibzdst-app-web/src/main/docker/Dockerfile
+1
-1
pom.xml
ibzdst-boot/pom.xml
+61
-0
DevBootInitializer.java
ibzdst-boot/src/main/java/cn/ibizlab/DevBootInitializer.java
+17
-0
NacosRegisterConfig.java
...java/cn/ibizlab/core/util/config/NacosRegisterConfig.java
+74
-0
XxlJobConfig.java
...c/main/java/cn/ibizlab/core/util/config/XxlJobConfig.java
+3
-1
systemResource.json
...st-core/src/main/resources/permission/systemResource.json
+1
-0
pom.xml
ibzdst-dependencies/pom.xml
+2
-0
Dockerfile
...t-provider/ibzdst-provider-api/src/main/docker/Dockerfile
+1
-1
ibzdst-provider-api-k8s.yaml
...provider-api/src/main/docker/ibzdst-provider-api-k8s.yaml
+2
-0
ibzdst-provider-api.yaml
...dst-provider-api/src/main/docker/ibzdst-provider-api.yaml
+7
-0
ibzdstapiInitializer.java
...pi/src/main/java/cn/ibizlab/api/ibzdstapiInitializer.java
+17
-0
application-api-prod.yml
...-provider-api/src/main/resources/application-api-prod.yml
+6
-1
未找到文件。
config.xml
浏览文件 @
291c25aa
...
...
@@ -37,12 +37,10 @@
git clone -b master $para2 ibzdst/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzdst/
mvn clean package -Papi
mvn install -Papi
mvn clean package -Papi-war
cd ibzdst-provider/ibzdst-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzdst-provider-api.yaml ibzlab-rt --with-registry-auth
mvn -Papi-war exec:exec@prepare
mvn -Papi-war exec:exec@buildpush
</command>
</hudson.tasks.Shell>
</builders>
...
...
ibzdst-app/ibzdst-app-web/src/main/docker/Dockerfile
浏览文件 @
291c25aa
FROM
adoptopenjdk/openjdk8:jdk8u242-b08-centos
FROM
image.ibizlab.cn/library/openjdk:8-jre-alpine
ENV
TZ=Asia/Shanghai \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
...
...
ibzdst-boot/pom.xml
浏览文件 @
291c25aa
...
...
@@ -12,6 +12,7 @@
<artifactId>
ibzdst-boot
</artifactId>
<name>
Ibzdst Dev Monolithic Boot
</name>
<description>
Ibzdst Boot
</description>
<packaging>
${project.packaging}
</packaging>
<dependencies>
<dependency>
...
...
@@ -64,6 +65,10 @@
</dependency>
</dependencies>
<properties>
<project.packaging>
jar
</project.packaging>
</properties>
<!--由于boot是通过dependency来关联所有子项目,页面和配置等信息都存在与子项目中,
所以您在对boot进行打包前,需要先将子项目install到maven仓库,以确保boot可以正常引用所有完整的子项目-->
<profiles>
...
...
@@ -117,6 +122,62 @@
</plugins>
</build>
</profile>
<profile>
<id>
boot-war
</id>
<properties>
<project.packaging>
war
</project.packaging>
</properties>
<build>
<resources>
<resource>
<directory>
${basedir}/src/main/resources
</directory>
<includes>
<include>
**/**
</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<finalName>
ibzdst
</finalName>
<jvmArguments>
-Dfile.encoding=UTF-8
</jvmArguments>
<mainClass>
cn.ibizlab.DevBootApplication
</mainClass>
<outputDirectory>
../
</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
com.spotify
</groupId>
<artifactId>
docker-maven-plugin
</artifactId>
<version>
0.4.13
</version>
<configuration>
<serverId>
ibiz-dev
</serverId>
<imageName>
ibiz4j/ibizlab-dst:latest
</imageName>
<dockerDirectory>
${project.basedir}/src/main/docker
</dockerDirectory>
<resources>
<resource>
<targetPath>
/
</targetPath>
<directory>
../
</directory>
<include>
ibzdst.war
</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
ibzdst-boot/src/main/java/cn/ibizlab/DevBootInitializer.java
0 → 100644
浏览文件 @
291c25aa
package
cn
.
ibizlab
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
/**
* 提供外部容器启动服务能力
*/
@Slf4j
public
class
DevBootInitializer
extends
SpringBootServletInitializer
{
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
builder
)
{
log
.
info
(
"--正在使用外部容器启动服务--"
);
return
builder
.
sources
(
DevBootApplication
.
class
);
}
}
ibzdst-core/src/main/java/cn/ibizlab/core/util/config/NacosRegisterConfig.java
0 → 100644
浏览文件 @
291c25aa
package
cn
.
ibizlab
.
core
.
util
.
config
;
import
com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration
;
import
cn.ibizlab.util.errors.BadRequestAlertException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
javax.management.MBeanServer
;
import
javax.management.ObjectName
;
import
javax.management.Query
;
import
java.lang.management.ManagementFactory
;
import
java.util.Set
;
/**
* 外部容器启动服务时,自动注册服务到nacos
*/
@Component
@Slf4j
public
class
NacosRegisterConfig
implements
ApplicationRunner
{
@Autowired
(
required
=
false
)
private
NacosAutoServiceRegistration
registration
;
@Value
(
"${server.port:8080}"
)
Integer
port
;
@Override
public
void
run
(
ApplicationArguments
args
)
{
log
.
info
(
"正在尝试将应用程序注册到nacos"
);
if
(
registration
!=
null
&&
port
!=
null
)
{
try
{
String
containerPort
=
getContainerPort
();
if
(!
StringUtils
.
isEmpty
(
containerPort
)){
registration
.
setPort
(
new
Integer
(
containerPort
));
}
else
{
registration
.
setPort
(
port
);
log
.
info
(
"无法获取外部容器端口,将使用程序默认端口{}"
,
port
);
}
registration
.
start
();
}
catch
(
Exception
e
)
{
throw
new
BadRequestAlertException
(
"应用程序注册到nacos失败,"
+
e
,
""
,
""
);
}
log
.
info
(
"已将应用程序成功注册到nacos"
);
}
else
{
log
.
info
(
"无法获取应用程序端口,将应用程序注册到nacos请求被忽略。"
);
}
}
/**
* 获取外部容器端口
*/
public
String
getContainerPort
(){
String
port
=
null
;
try
{
MBeanServer
beanServer
=
ManagementFactory
.
getPlatformMBeanServer
();
Set
<
ObjectName
>
objectNames
=
beanServer
.
queryNames
(
new
ObjectName
(
"*:type=Connector,*"
),
Query
.
match
(
Query
.
attr
(
"protocol"
),
Query
.
value
(
"HTTP/1.1"
)));
if
(!
ObjectUtils
.
isEmpty
(
objectNames
)){
port
=
objectNames
.
iterator
().
next
().
getKeyProperty
(
"port"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"获取外部容器端口失败!"
+
e
);
}
return
port
;
}
}
ibzdst-core/src/main/java/cn/ibizlab/core/util/config/XxlJobConfig.java
浏览文件 @
291c25aa
package
cn
.
ibizlab
.
core
.
util
.
config
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnExpression
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Configuration
;
import
com.baomidou.jobs.starter.EnableJobs
;
@ConditionalOnExpression
(
"!'${jobs.admin-address:NA}'.equals('NA')"
)
//@ConditionalOnExpression("!'${jobs.admin-address:NA}'.equals('NA')")
@ConditionalOnProperty
(
name
=
"jobs.enabled"
,
havingValue
=
"true"
,
matchIfMissing
=
false
)
@EnableJobs
@Configuration
public
class
XxlJobConfig
{
...
...
ibzdst-core/src/main/resources/permission/systemResource.json
浏览文件 @
291c25aa
{
"systemid"
:
"ibzdst"
,
"systemname"
:
"ibzdst"
,
"unires"
:[
],
"entities"
:[
...
...
ibzdst-dependencies/pom.xml
浏览文件 @
291c25aa
...
...
@@ -83,6 +83,8 @@
<!-- 阿里seata分布式事务 -->
<alibaba-seata.version>
1.3.0
</alibaba-seata.version>
<log4j2.version>
2.16.0
</log4j2.version>
<oracle.version>
19.8.0.0
</oracle.version>
<postgresql.version>
42.2.6
</postgresql.version>
<flowable-modeler.version>
6.4.2
</flowable-modeler.version>
...
...
ibzdst-provider/ibzdst-provider-api/src/main/docker/Dockerfile
浏览文件 @
291c25aa
FROM
adoptopenjdk/openjdk8:jdk8u242-b08-centos
FROM
image.ibizlab.cn/library/openjdk:8-jre-alpine
ENV
TZ=Asia/Shanghai \
SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
...
...
ibzdst-provider/ibzdst-provider-api/src/main/docker/ibzdst-provider-api-k8s.yaml
浏览文件 @
291c25aa
...
...
@@ -46,6 +46,8 @@ spec:
value
:
"
com.mysql.jdbc.Driver"
-
name
:
SPRING_DATASOURCE_DEFAULTSCHEMA
value
:
"
a_A_5d9d78509"
-
name
:
IBIZ_DEPLOY_PACKAGETYPE
value
:
"
war"
-
name
:
NACOS
value
:
"
172.16.100.243:8848"
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_GROUP
...
...
ibzdst-provider/ibzdst-provider-api/src/main/docker/ibzdst-provider-api.yaml
浏览文件 @
291c25aa
...
...
@@ -6,6 +6,12 @@ services:
-
"
40011:40011"
networks
:
-
agent_network
logging
:
driver
:
loki
options
:
loki-url
:
"
http://172.16.240.111:3100/loki/api/v1/push"
max-size
:
"
50m"
max-file
:
"
10"
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
-
SERVER_PORT=40011
...
...
@@ -18,6 +24,7 @@ services:
-
SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true&serverTimezone=GMT%2B8
-
SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
-
SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
-
IBIZ_DEPLOY_PACKAGETYPE=war
-
NACOS=172.16.100.243:8848
-
SPRING_CLOUD_NACOS_DISCOVERY_GROUP=ibizdev
deploy
:
...
...
ibzdst-provider/ibzdst-provider-api/src/main/java/cn/ibizlab/api/ibzdstapiInitializer.java
0 → 100644
浏览文件 @
291c25aa
package
cn
.
ibizlab
.
api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
/**
* 提供外部容器启动服务能力
*/
@Slf4j
public
class
ibzdstapiInitializer
extends
SpringBootServletInitializer
{
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
builder
)
{
log
.
info
(
"--正在使用外部容器启动服务--"
);
return
builder
.
sources
(
ibzdstapiApplication
.
class
);
}
}
ibzdst-provider/ibzdst-provider-api/src/main/resources/application-api-prod.yml
浏览文件 @
291c25aa
...
...
@@ -3,4 +3,9 @@ server:
#Log配置
logging
:
level
:
cn.ibizlab
:
info
\ No newline at end of file
cn.ibizlab
:
info
## jobs
jobs
:
app-port
:
9999
enabled
:
true
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录