提交 f1a1dea5 authored 作者: chenshiying's avatar chenshiying

[新增] 配置修改

上级 fc0d10ca
# 目录说明
bin (生产的脚本及其配置)
template (模板)
# 初始化脚本步骤 # 初始化脚本步骤
1、使用代码生成 1、使用代码生成
2、将生成的bin 下的文件上传服务器(192.169.201.14) /home/soft/deploy 文件夹 2、将生成的bin 下的文件上传服务器(192.169.201.14) /home/soft/deploy 文件夹
...@@ -128,8 +133,6 @@ curl -X POST -u admin:adminloit -H "Content-Type:application/xml" -H "Jenkins-Cr ...@@ -128,8 +133,6 @@ curl -X POST -u admin:adminloit -H "Content-Type:application/xml" -H "Jenkins-Cr
移动门户 移动门户
# gateway
9、批量更新拉取git构建上传批量更新jenkinsjob 9、批量更新拉取git构建上传批量更新jenkinsjob
UPDATE loit_model_version t SET t.upload_type='0',t.code_branch="origin/test",t.jenkins_job=(SELECT CONCAT('loit-git-branch-',SUBSTRING(model_service_name,6),"-module-build") FROM loit_project_model m WHERE m.model_id=t.model_id) UPDATE loit_model_version t SET t.upload_type='0',t.code_branch="origin/test",t.jenkins_job=(SELECT CONCAT('loit-git-branch-',SUBSTRING(model_service_name,6),"-module-build") FROM loit_project_model m WHERE m.model_id=t.model_id)
...@@ -139,3 +142,5 @@ UPDATE loit_model_version t SET t.upload_type='0',t.code_branch="origin/test",t. ...@@ -139,3 +142,5 @@ UPDATE loit_model_version t SET t.upload_type='0',t.code_branch="origin/test",t.
rm -rf /var/jenkins_home/.m2/repository/com/loit/* rm -rf /var/jenkins_home/.m2/repository/com/loit/*
ls -la /var/jenkins_home/.m2/repository/com/loit/ ls -la /var/jenkins_home/.m2/repository/com/loit/
...@@ -74,9 +74,7 @@ public class GeneratorScript { ...@@ -74,9 +74,7 @@ public class GeneratorScript {
} }
BackendFrontEnum backendFrontType = BackendFrontEnum.getEnumByCode(deployDataDTO.getBackendFrontType()); BackendFrontEnum backendFrontType = BackendFrontEnum.getEnumByCode(deployDataDTO.getBackendFrontType());
if (BackendFrontEnum.BACKEND.equals(backendFrontType)) {
continue;
}
String serviceName = deployDataDTO.getServiceName(); String serviceName = deployDataDTO.getServiceName();
FrontInstanceDto frontInstanceDto = frontInstanceDtoMap.get(serviceName); FrontInstanceDto frontInstanceDto = frontInstanceDtoMap.get(serviceName);
...@@ -117,12 +115,20 @@ public class GeneratorScript { ...@@ -117,12 +115,20 @@ public class GeneratorScript {
model.put("serviceNameAbb", frontInstanceDto.getServiceNameAbb()); model.put("serviceNameAbb", frontInstanceDto.getServiceNameAbb());
model.put("grayList", frontInstanceDto.getGrayList()); model.put("grayList", frontInstanceDto.getGrayList());
model.put("normalList", frontInstanceDto.getNormalList()); model.put("normalList", frontInstanceDto.getNormalList());
model.put("backendFrontType", frontInstanceDto.getBackendFrontType().getCode()); BackendFrontEnum backendFrontType = frontInstanceDto.getBackendFrontType();
model.put("backendFrontType", backendFrontType.getCode());
if (BackendFrontEnum.BACKEND.equals(backendFrontType)) {
// 构建gateway 配置
buildGatewayConfig(model);
} else {
//创建政务网nginx配置
buildFrontZwwNginxConfig(model);
buildFrontHlwNginxConfig(model);
}
//创建政务网nginx配置
buildFrontZwwNginxConfig(model);
buildFrontHlwNginxConfig(model);
}); });
} catch (Exception e) { } catch (Exception e) {
...@@ -295,4 +301,13 @@ public class GeneratorScript { ...@@ -295,4 +301,13 @@ public class GeneratorScript {
String nginxConfig = FreeMarkerUtils.process("sh\\hlw-nginx-upstream.ftl", model); String nginxConfig = FreeMarkerUtils.process("sh\\hlw-nginx-upstream.ftl", model);
FileUtils.appendNewLine(nginxConfigDir, nginxConfig); FileUtils.appendNewLine(nginxConfigDir, nginxConfig);
} }
private static void buildGatewayConfig(Map model) {
String nginxConfigDir = root_path_full + "\\gateway.conf";
FileUtils.appendNewLine(nginxConfigDir, "----------------------------------" + model.get("serviceName") + "----------------------------------");
String nginxConfig = FreeMarkerUtils.process("sh\\gateway.ftl", model);
FileUtils.appendNewLine(nginxConfigDir, nginxConfig);
}
} }
- id: loit-${serviceName}
uri: lb://loit-${serviceName}
predicates:
- Path=/api-${serviceName}/**
filters:
- StripPrefix=1
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论