Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
24cb8ddc
提交
24cb8ddc
编写于
9月 07, 2021
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong 部署微服务接口 [ibz-dst,micorservice]
上级
d880dd45
变更
9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
89 行增加
和
60 行删除
+89
-60
config.xml
config.xml
+6
-6
Dockerfile
ibzdst-app/ibzdst-app-web/src/main/docker/Dockerfile
+1
-1
ibzdst-app-web-k8s.yaml
...pp/ibzdst-app-web/src/main/docker/ibzdst-app-web-k8s.yaml
+4
-31
ibzdst-app-web.yaml
...st-app/ibzdst-app-web/src/main/docker/ibzdst-app-web.yaml
+1
-15
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
+31
-4
ibzdst-provider-api.yaml
...dst-provider-api/src/main/docker/ibzdst-provider-api.yaml
+15
-1
ExceptionTranslator.java
...main/java/cn/ibizlab/util/errors/ExceptionTranslator.java
+29
-0
AuthenticationEntryPoint.java
...va/cn/ibizlab/util/security/AuthenticationEntryPoint.java
+1
-1
未找到文件。
config.xml
浏览文件 @
24cb8ddc
...
...
@@ -37,12 +37,12 @@
git clone -b master $para2 ibzdst/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibzdst/
mvn clean package -P
web
mvn install -P
web
cd ibzdst-
app/ibzdst-app-web
mvn -P
web
docker:build
mvn -P
web
docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzdst-
app-web.yaml ibzlab-rt --with-registry-auth
mvn clean package -P
api
mvn install -P
api
cd ibzdst-
provider/ibzdst-provider-api
mvn -P
api
docker:build
mvn -P
api
docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzdst-
provider-api.yaml ibzlab-rt --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
...
...
ibzdst-app/ibzdst-app-web/src/main/docker/Dockerfile
浏览文件 @
24cb8ddc
...
...
@@ -10,6 +10,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Duser.timezone=$TZ -Djava.security.egd=file:/dev/./urandom -jar /ibzdst-app-web.jar
EXPOSE
30011
EXPOSE
8080
ADD
ibzdst-app-web.jar /ibzdst-app-web.jar
ibzdst-app/ibzdst-app-web/src/main/docker/ibzdst-app-web-k8s.yaml
浏览文件 @
24cb8ddc
...
...
@@ -22,34 +22,7 @@ spec:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzdst-app-web:latest
imagePullPolicy
:
Always
ports
:
-
containerPort
:
30011
env
:
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_IP
value
:
"
172.16.180.237"
-
name
:
SERVER_PORT
value
:
"
30011"
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR
value
:
"
172.16.100.243:8848"
-
name
:
SPRING_REDIS_HOST
value
:
"
172.16.100.243"
-
name
:
SPRING_REDIS_PORT
value
:
"
6379"
-
name
:
SPRING_REDIS_DATABASE
value
:
"
0"
-
name
:
SPRING_DATASOURCE_USERNAME
value
:
"
a_A_5d9d78509"
-
name
:
SPRING_DATASOURCE_PASSWORD
value
:
"
@6dEfb3@"
-
name
:
SPRING_DATASOURCE_URL
value
:
"
jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true"
-
name
:
SPRING_DATASOURCE_DRIVER-CLASS-NAME
value
:
"
com.mysql.jdbc.Driver"
-
name
:
SPRING_DATASOURCE_DEFAULTSCHEMA
value
:
"
a_A_5d9d78509"
-
name
:
NACOS
value
:
"
172.16.100.243:8848"
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_GROUP
value
:
"
ibizdev"
-
containerPort
:
8080
volumeMounts
:
-
name
:
data
mountPath
:
/app/file
...
...
@@ -69,9 +42,9 @@ spec:
type
:
NodePort
ports
:
-
name
:
http
port
:
30011
targetPort
:
30011
nodePort
:
30011
port
:
8080
targetPort
:
8080
nodePort
:
8080
protocol
:
TCP
selector
:
app
:
ibzdst-app-web
...
...
ibzdst-app/ibzdst-app-web/src/main/docker/ibzdst-app-web.yaml
浏览文件 @
24cb8ddc
...
...
@@ -3,23 +3,9 @@ services:
ibzdst-app-web
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzdst-app-web:latest
ports
:
-
"
30011:30011
"
-
"
8080:8080
"
networks
:
-
agent_network
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
-
SERVER_PORT=30011
-
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.100.243:8848
-
SPRING_REDIS_HOST=172.16.100.243
-
SPRING_REDIS_PORT=6379
-
SPRING_REDIS_DATABASE=0
-
SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
-
SPRING_DATASOURCE_PASSWORD=@6dEfb3@
-
SPRING_DATASOURCE_URL=jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
-
SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
-
SPRING_DATASOURCE_DEFAULTSCHEMA=a_A_5d9d78509
-
NACOS=172.16.100.243:8848
-
SPRING_CLOUD_NACOS_DISCOVERY_GROUP=ibizdev
deploy
:
resources
:
limits
:
...
...
ibzdst-provider/ibzdst-provider-api/src/main/docker/Dockerfile
浏览文件 @
24cb8ddc
...
...
@@ -10,6 +10,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Duser.timezone=$TZ -Djava.security.egd=file:/dev/./urandom -jar /ibzdst-provider-api.jar
EXPOSE
808
1
EXPOSE
4001
1
ADD
ibzdst-provider-api.jar /ibzdst-provider-api.jar
ibzdst-provider/ibzdst-provider-api/src/main/docker/ibzdst-provider-api-k8s.yaml
浏览文件 @
24cb8ddc
...
...
@@ -22,7 +22,34 @@ spec:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzdst-provider-api:latest
imagePullPolicy
:
Always
ports
:
-
containerPort
:
8081
-
containerPort
:
40011
env
:
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_IP
value
:
"
172.16.180.237"
-
name
:
SERVER_PORT
value
:
"
40011"
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR
value
:
"
172.16.100.243:8848"
-
name
:
SPRING_REDIS_HOST
value
:
"
172.16.100.243"
-
name
:
SPRING_REDIS_PORT
value
:
"
6379"
-
name
:
SPRING_REDIS_DATABASE
value
:
"
0"
-
name
:
SPRING_DATASOURCE_USERNAME
value
:
"
a_A_5d9d78509"
-
name
:
SPRING_DATASOURCE_PASSWORD
value
:
"
@6dEfb3@"
-
name
:
SPRING_DATASOURCE_URL
value
:
"
jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true&serverTimezone=GMT%2B8"
-
name
:
SPRING_DATASOURCE_DRIVER-CLASS-NAME
value
:
"
com.mysql.jdbc.Driver"
-
name
:
SPRING_DATASOURCE_DEFAULTSCHEMA
value
:
"
a_A_5d9d78509"
-
name
:
NACOS
value
:
"
172.16.100.243:8848"
-
name
:
SPRING_CLOUD_NACOS_DISCOVERY_GROUP
value
:
"
ibizdev"
volumeMounts
:
-
name
:
data
mountPath
:
/app/file
...
...
@@ -42,9 +69,9 @@ spec:
type
:
NodePort
ports
:
-
name
:
http
port
:
808
1
targetPort
:
808
1
nodePort
:
808
1
port
:
4001
1
targetPort
:
4001
1
nodePort
:
4001
1
protocol
:
TCP
selector
:
app
:
ibzdst-provider-api
...
...
ibzdst-provider/ibzdst-provider-api/src/main/docker/ibzdst-provider-api.yaml
浏览文件 @
24cb8ddc
...
...
@@ -3,9 +3,23 @@ services:
ibzdst-provider-api
:
image
:
registry.cn-shanghai.aliyuncs.com/ibizsys/ibzdst-provider-api:latest
ports
:
-
"
8081:808
1"
-
"
40011:4001
1"
networks
:
-
agent_network
environment
:
-
SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.180.237
-
SERVER_PORT=40011
-
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.100.243:8848
-
SPRING_REDIS_HOST=172.16.100.243
-
SPRING_REDIS_PORT=6379
-
SPRING_REDIS_DATABASE=0
-
SPRING_DATASOURCE_USERNAME=a_A_5d9d78509
-
SPRING_DATASOURCE_PASSWORD=@6dEfb3@
-
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
-
NACOS=172.16.100.243:8848
-
SPRING_CLOUD_NACOS_DISCOVERY_GROUP=ibizdev
deploy
:
resources
:
limits
:
...
...
ibzdst-util/src/main/java/cn/ibizlab/util/errors/ExceptionTranslator.java
浏览文件 @
24cb8ddc
...
...
@@ -9,6 +9,8 @@ import org.springframework.web.bind.MethodArgumentNotValidException;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.context.request.NativeWebRequest
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.multipart.MaxUploadSizeExceededException
;
import
org.zalando.problem.DefaultProblem
;
import
org.zalando.problem.Problem
;
import
org.zalando.problem.ProblemBuilder
;
...
...
@@ -105,4 +107,31 @@ public class ExceptionTranslator implements ProblemHandling {
headers
.
add
(
"X-ibz-params"
,
entityName
);
return
headers
;
}
/**
* 上传文件大小超出限制异常
*/
@Value
(
"${spring.servlet.multipart.max-file-size}"
)
private
String
maxFileSize
;
@ExceptionHandler
(
MaxUploadSizeExceededException
.
class
)
public
ResponseEntity
<
Problem
>
handlerMaxUploadFile
(
MaxUploadSizeExceededException
ex
,
NativeWebRequest
request
){
Problem
problem
=
Problem
.
builder
()
.
withStatus
(
Status
.
BAD_REQUEST
)
.
withDetail
(
"上传文件不能大于"
+
maxFileSize
)
.
with
(
"message"
,
"上传文件不能大于"
+
maxFileSize
)
.
with
(
"exmessage"
,
""
+
ex
.
getMessage
())
.
build
();
return
create
(
ex
,
problem
,
request
);
}
@ExceptionHandler
(
Exception
.
class
)
public
ResponseEntity
<
Problem
>
handlerTest
(
Exception
ex
,
NativeWebRequest
request
){
Problem
problem
=
Problem
.
builder
()
.
withStatus
(
Status
.
INTERNAL_SERVER_ERROR
)
.
withDetail
(
"内部服务器异常"
)
.
with
(
"message"
,
"内部服务器异常"
)
.
with
(
"exmessage"
,
""
+
ex
.
getMessage
())
.
build
();
return
create
(
ex
,
problem
,
request
);
}
}
ibzdst-util/src/main/java/cn/ibizlab/util/security/AuthenticationEntryPoint.java
浏览文件 @
24cb8ddc
...
...
@@ -20,7 +20,7 @@ public class AuthenticationEntryPoint implements org.springframework.security.we
/**
* 当用户尝试访问安全的REST资源而不提供任何凭据时,将调用此方法发送401 响应
*/
response
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
,
authException
==
null
?
"Unauthorized"
:
authException
.
getMessage
()
);
response
.
sendError
(
HttpServletResponse
.
SC_UNAUTHORIZED
,
"账号身份已过期,请重新登录。"
);
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录