提交 76f14a42 编写于 作者: zhouweidong's avatar zhouweidong

docker yml补充sysrun参数

上级 3d122102
......@@ -2,11 +2,54 @@
TARGET=PSSYSAPP
</#ibiztemplate>
<#assign httpPort = "8080">
<#if sysrun?? >
<#if sysrun.getPSDevSlnMSDepApp()??>
<#if sysrun.getPSDevSlnMSDepApp().getHttpPort()??>
<#assign httpPort = sysrun.getPSDevSlnMSDepApp().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.getPSDevSlnMSDepApp()?? && >
<#assign depApp=sysrun.getPSDevSlnMSDepApp()>
<#if depApp.getHttpPort()??>
<#assign httpPort = sysrun.getPSDevSlnMSDepApp().getHttpPort()?c>
</#if>
<#if depApp.getPSDCMSPlatformNode()??>
<#assign appPlatformNode=depApp.getPSDCMSPlatformNode()>
<#assign appPlatform=depApp.getPSDCMSPlatform()>
<#if appPlatform.getUserParam("nacos","172.16.102.211:8848")??>
<#assign nacosUrl = appPlatform.getUserParam("nacos","172.16.102.211:8848")>
</#if>
<#if appPlatform.getUserParam("spring.redis.host","172.16.100.243")??>
<#assign redisHost = appPlatform.getUserParam("spring.redis.host","172.16.100.243")>
</#if>
<#if appPlatform.getUserParam("spring.redis.port","6379")??>
<#assign redisPort = appPlatform.getUserParam("spring.redis.port","6379")>
</#if>
<#if appPlatform.getUserParam("spring.redis.database","0")??>
<#assign redisDataBase = appPlatform.getUserParam("spring.redis.database","0")>
</#if>
</#if>
</#if>
<#comment>一键发布数据库配置</#comment>
<#if sysrun.getPSDBDevInst()??>
<#assign sysRunDBInst = sysrun.getPSDBDevInst()>
<#assign dbUserName=sysRunDBInst.getUserName()>
<#assign dbPassWord=sysRunDBInst.getPassword()>
<#assign dbUrl=sysRunDBInst.getConnUrl()>
<#if (sysRunDBInst.getDBType()=='MYSQL5')>
<#assign dbDriver="com.mysql.jdbc.Driver">
<#elseif (sysRunDBInst.getDBType()=='DB2')>
<#assign dbDriver="com.ibm.db2.jcc.DB2Driver">
<#elseif (sysRunDBInst.getDBType()=='ORACLE')>
<#assign dbDriver="oracle.jdbc.driver.OracleDriver">
<#elseif (sysRunDBInst.getDBType()=='SQLSERVER')>
<#assign dbDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver">
<#elseif (sysRunDBInst.getDBType()=='POSTGRESQL')>
<#assign dbDriver="org.postgresql.Driver">
<#elseif (sysRunDBInst.getDBType()=='PPAS')>
<#assign dbDriver="com.edb.Driver">
</#if>
</#if>
version: "3.2"
......@@ -25,11 +68,21 @@ services:
<#if appPlatformNode.getSSHIPAddr()??>
SPRING_CLOUD_NACOS_DISCOVERY_IP: ${appPlatformNode.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 depApp.getUserParamNames()??>
<@outputUserParam depApp depApp.getUserParamNames()/>
</#if>
<#comment>输出微服务平台自定义参数</#comment>
<#comment>输出微服务平台自定义参数替换标准参数</#comment>
<#if appPlatform.getUserParamNames()??>
<@outputUserParam appPlatform appPlatform.getUserParamNames()/>
</#if>
......@@ -46,8 +99,16 @@ networks:
<#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList>
<#list paramList as 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('AppDeployUserParam',param)>
${param?upper_case?replace(".","_")?replace("-","")}: ${paramObj.getUserParam(param,"")}
userParamkey: ${paramObj.getUserParam(param,"")}
</#if>
</#if>
</#list>
</#macro>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册