提交 68bcf9a1 编写于 作者: zhouweidong's avatar zhouweidong

docker yml补充sysrun参数

上级 76f14a42
......@@ -10,7 +10,7 @@ TARGET=PSSYSAPP
<#assign dbPassWord="123456">
<#assign dbUrl="jdbc:mysql://127.0.0.1:3306/"+sys.name+"?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true">
<#assign dbDriver="com.mysql.jdbc.Driver">
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()?? && >
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()??>
<#assign depApp=sysrun.getPSDevSlnMSDepApp()>
<#if depApp.getHttpPort()??>
<#assign httpPort = sysrun.getPSDevSlnMSDepApp().getHttpPort()?c>
......@@ -32,7 +32,7 @@ TARGET=PSSYSAPP
</#if>
</#if>
</#if>
<#comment>一键发布数据库配置</#comment>
<#comment>数据库配置</#comment>
<#if sysrun.getPSDBDevInst()??>
<#assign sysRunDBInst = sysrun.getPSDBDevInst()>
<#assign dbUserName=sysRunDBInst.getUserName()>
......
......@@ -2,13 +2,37 @@
TARGET=PSSYSSERVICEAPI
</#ibiztemplate>
<#assign httpPort = "8081">
<#if sysrun?? >
<#if sysrun.getPSDevSlnMSDepAPI()??>
<#if sysrun.getPSDevSlnMSDepAPI().getHttpPort()??>
<#assign httpPort = sysrun.getPSDevSlnMSDepAPI().getHttpPort()?c>
<#assign nacosUrl = "172.16.102.211:8848" >
<#assign redisHost = "172.16.100.243" >
<#assign redisPort = "6379" >
<#assign redisDataBase = "0" >
<#assign dbUserName="root">
<#assign dbPassWord="123456">
<#assign dbUrl="jdbc:mysql://127.0.0.1:3306/"+sys.name+"?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true">
<#assign dbDriver="com.mysql.jdbc.Driver">
<#if sysrun?? && sysrun.getPSDevSlnMSDepAPI()?? >
<#assign depSysApi=sysrun.getPSDevSlnMSDepAPI()>
<#if depSysApi.getHttpPort()??>
<#assign httpPort = depSysApi.getHttpPort()?c>
</#if>
<#if depSysApi.getPSDCMSPlatformNode()??>
<#assign depSysApiPlatformNode=depSysApi.getPSDCMSPlatformNode()>
<#assign depSysApiPlatform=depSysApi.getPSDCMSPlatform()>
<#if depSysApiPlatform.getUserParam("nacos","172.16.102.211:8848")??>
<#assign nacosUrl = depSysApiPlatform.getUserParam("nacos","172.16.102.211:8848")>
</#if>
<#if depSysApiPlatform.getUserParam("spring.redis.host","172.16.100.243")??>
<#assign redisHost = depSysApiPlatform.getUserParam("spring.redis.host","172.16.100.243")>
</#if>
<#if depSysApiPlatform.getUserParam("spring.redis.port","6379")??>
<#assign redisPort = depSysApiPlatform.getUserParam("spring.redis.port","6379")>
</#if>
<#if depSysApiPlatform.getUserParam("spring.redis.database","0")??>
<#assign redisDataBase = depSysApiPlatform.getUserParam("spring.redis.database","0")>
</#if>
</#if>
</#if>
version: "3.2"
services:
${pub.getCodeName()?lower_case}-provider-${api.getCodeName()?lower_case}:
......@@ -25,11 +49,21 @@ services:
<#if depSysApiPlatformNode.getSSHIPAddr()??>
SPRING_CLOUD_NACOS_DISCOVERY_IP: ${depSysApiPlatformNode.getSSHIPAddr()}
</#if>
<#comment>输出服务接口自定义参数</#comment>
<#comment>系统运行参数设置,从SysRun中获取到当前部署相关信息</#comment>
SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR: ${nacosUrl}
SPRING_REDIS_HOST: ${redisHost}
SPRING_REDIS_PORT: ${redisPort}
SPRING_REDIS_DATABASE: ${redisDataBase}
SPRING_DATASOURCE_USERNAME: ${dbUserName}
SPRING_DATASOURCE_PASSWORD: ${dbPassWord}
SPRING_DATASOURCE_URL: ${dbUrl}
SPRING_DATASOURCE_DRIVER-CLASS-NAME: ${dbDriver}
SPRING_DATASOURCE_DEFAULTSCHEMA: ${dbUserName}
<#comment>输出服务接口自定义参数替换标准参数</#comment>
<#if depSysApi.getUserParamNames()??>
<@outputUserParam depSysApi depSysApi.getUserParamNames()/>
</#if>
<#comment>输出微服务平台自定义参数</#comment>
<#comment>输出微服务平台自定义参数替换标准参数</#comment>
<#if depSysApiPlatform.getUserParamNames()??>
<@outputUserParam depSysApiPlatform depSysApiPlatform.getUserParamNames()/>
</#if>
......@@ -46,8 +80,16 @@ networks:
<#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList>
<#list paramList as param>
<#if !P.exists('SysApiDeployUserParam',param)>
${param?upper_case?replace(".","_")}: ${paramObj.getUserParam(param,"")}
<#assign userParamkey=param?upper_case?replace(".","_")?replace("-","")>
<#comment>nacos、数据库连接等信息从sysRun中获取</#comment>
<#if userParamkey!="SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR" && userParamkey!="SPRING_REDIS_HOST" &&
userParamkey!="SPRING_REDIS_PORT" &&userParamkey!="SPRING_REDIS_DATABASE"
&&userParamkey!="SPRING_DATASOURCE_USERNAME" &&userParamkey!="SPRING_DATASOURCE_PASSWORD"
&&userParamkey!="SPRING_DATASOURCE_URL" &&userParamkey!="SPRING_DATASOURCE_DRIVER-CLASS-NAME" &&userParamkey!="SPRING_DATASOURCE_DEFAULTSCHEMA">
<#comment>扩展标准配置:用户配置参数替换标准配置(application-sys.yml)</#comment>
<#if !P.exists('SysApiDeployUserParam',param)>
userParamkey: ${paramObj.getUserParam(param,"")}
</#if>
</#if>
</#list>
</#macro>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册