提交 c206ad25 编写于 作者: sq3536's avatar sq3536

init

上级 2504db83
<#ibiztemplate> <#ibiztemplate>
TARGET=PSSYSAPP TARGET=PSSYSAPP
</#ibiztemplate> </#ibiztemplate>
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()??>
<#assign httpPort = "8080"> <#assign httpPort = "8080">
<#assign nacosUrl = "127.0.0.1:8848" > <#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" > <#assign redisHost = "127.0.0.1" >
...@@ -98,22 +99,6 @@ spec: ...@@ -98,22 +99,6 @@ spec:
value: "${httpPort}" value: "${httpPort}"
- name: SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR - name: SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR
value: "${nacosUrl}" value: "${nacosUrl}"
- name: SPRING_REDIS_HOST
value: "${redisHost}"
- name: SPRING_REDIS_PORT
value: "${redisPort}"
- name: SPRING_REDIS_DATABASE
value: "${redisDataBase}"
- name: SPRING_DATASOURCE_USERNAME
value: "${dbUserName}"
- name: SPRING_DATASOURCE_PASSWORD
value: "${dbPassWord}"
- name: SPRING_DATASOURCE_URL
value: "${dbUrl}"
- name: SPRING_DATASOURCE_DRIVER-CLASS-NAME
value: "${dbDriver}"
- name: SPRING_DATASOURCE_DEFAULTSCHEMA
value: "${dbUserName}"
<#comment>输出前端应用自定义参数替换标准参数</#comment> <#comment>输出前端应用自定义参数替换标准参数</#comment>
<#if depApp.getUserParamNames()??> <#if depApp.getUserParamNames()??>
<@outputUserParam depApp depApp.getUserParamNames()/> <@outputUserParam depApp depApp.getUserParamNames()/>
...@@ -148,7 +133,7 @@ spec: ...@@ -148,7 +133,7 @@ spec:
protocol: TCP protocol: TCP
selector: selector:
app: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case} app: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}
</#if>
<#comment>输出用户自定义参数</#comment> <#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList> <#macro outputUserParam paramObj paramList>
<#list paramList as param> <#list paramList as param>
......
<#ibiztemplate> <#ibiztemplate>
TARGET=PSSYSAPP TARGET=PSSYSAPP
</#ibiztemplate> </#ibiztemplate>
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()??>
<#assign httpPort = "8080"> <#assign httpPort = "8080">
<#assign nacosUrl = "127.0.0.1:8848" > <#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" > <#assign redisHost = "127.0.0.1" >
...@@ -68,7 +69,7 @@ TARGET=PSSYSAPP ...@@ -68,7 +69,7 @@ TARGET=PSSYSAPP
version: "3.2" version: "3.2"
services: services:
${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}: ${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/${pub.getCodeName()?lower_case}-app-${app.getPKGCodeName()?lower_case}:latest image: ${dockerimage}
ports: ports:
- "${httpPort}:${httpPort}" - "${httpPort}:${httpPort}"
<#if dockerPortMap!=''> <#if dockerPortMap!=''>
...@@ -93,14 +94,7 @@ services: ...@@ -93,14 +94,7 @@ services:
<#comment>系统运行参数设置,从SysRun中获取到当前部署相关信息</#comment> <#comment>系统运行参数设置,从SysRun中获取到当前部署相关信息</#comment>
- SERVER_PORT=${httpPort} - SERVER_PORT=${httpPort}
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=${nacosUrl} - SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=${nacosUrl}
- SPRING_REDIS_HOST=${redisHost} - SPRING_CLOUD_NACOS_CONFIG_SERVER-ADDR=${nacosUrl}
- 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> <#comment>输出前端应用自定义参数替换标准参数</#comment>
<#if depApp.getUserParamNames()??> <#if depApp.getUserParamNames()??>
<@outputUserParam depApp depApp.getUserParamNames()/> <@outputUserParam depApp depApp.getUserParamNames()/>
...@@ -130,14 +124,14 @@ volumes: ...@@ -130,14 +124,14 @@ volumes:
driver: local driver: local
driver_opts: driver_opts:
type: "nfs" type: "nfs"
o: "addr=172.16.240.109,rw" o: "addr=172.16.240.140,rw"
device: ":/nfs" device: ":/data/nfs"
networks: networks:
agent_network: agent_network:
driver: overlay driver: overlay
attachable: true attachable: true
</#if>
<#comment>输出用户自定义参数</#comment> <#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList> <#macro outputUserParam paramObj paramList>
<#list paramList as param> <#list paramList as param>
......
<#ibiztemplate> <#ibiztemplate>
TARGET=PSSYSSERVICEAPI TARGET=PSSYSSERVICEAPI
</#ibiztemplate> </#ibiztemplate>
<#if sysrun?? && sysrun.getPSDevSlnMSDepAPI()?? && sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode()??>
<#assign httpPort = "8081"> <#assign httpPort = "8081">
<#assign nacosUrl = "127.0.0.1:8848" > <#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" > <#assign redisHost = "127.0.0.1" >
...@@ -152,7 +153,7 @@ spec: ...@@ -152,7 +153,7 @@ spec:
</#if> </#if>
selector: selector:
app: ${pub.getCodeName()?lower_case}-boot app: ${pub.getCodeName()?lower_case}-boot
</#if>
<#comment>输出用户自定义参数</#comment> <#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList> <#macro outputUserParam paramObj paramList>
<#list paramList as param> <#list paramList as param>
......
<#ibiztemplate> <#ibiztemplate>
TARGET=PSSYSSERVICEAPI TARGET=PSSYSSERVICEAPI
</#ibiztemplate> </#ibiztemplate>
<#if sysrun?? && sysrun.getPSDevSlnMSDepAPI()?? && sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode()??>
<#assign httpPort = "8081"> <#assign httpPort = "8081">
<#assign nacosUrl = "127.0.0.1:8848" > <#assign nacosUrl = "127.0.0.1:8848" >
<#assign redisHost = "127.0.0.1" > <#assign redisHost = "127.0.0.1" >
...@@ -143,7 +144,7 @@ networks: ...@@ -143,7 +144,7 @@ networks:
agent_network: agent_network:
driver: overlay driver: overlay
attachable: true attachable: true
</#if>
<#comment>输出用户自定义参数</#comment> <#comment>输出用户自定义参数</#comment>
<#macro outputUserParam paramObj paramList> <#macro outputUserParam paramObj paramList>
<#list paramList as param> <#list paramList as param>
......
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<#if sysrun?? && sysrun.getPSDevSlnMSDepApp()?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()??>
<#assign httpPort = "8080">
<#assign timezone = "Asia/Shanghai">
<#if sysrun?? >
<#if sysrun.getPSDevSlnMSDepApp()??>
<#if sysrun.getPSDevSlnMSDepApp().getHttpPort()??>
<#assign httpPort = sysrun.getPSDevSlnMSDepApp().getHttpPort()?c>
</#if>
<#if sysrun.getPSDevSlnMSDepApp().getUserParam("timezone","")?? && sysrun.getPSDevSlnMSDepApp().getUserParam("timezone","")!="">
<#assign timezone = sysrun.getPSDevSlnMSDepApp().getUserParam("timezone","")>
<#elseif sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatform().getUserParam("timezone","")?? && sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatform().getUserParam("timezone","")!="">
<#assign timezone = sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatform().getUserParam("timezone","")>
</#if>
</#if>
</#if>
FROM ibiz4j/ibizlab-gateway:latest
ENV TZ=${timezone}
EXPOSE ${httpPort}
WORKDIR /
COPY dist /dist
</#if>
\ No newline at end of file
...@@ -82,8 +82,12 @@ TARGET=PSSYSTEM ...@@ -82,8 +82,12 @@ TARGET=PSSYSTEM
mkdir -p /var/lib/jenkins/appcache/${depapp.getId()} mkdir -p /var/lib/jenkins/appcache/${depapp.getId()}
if [ -e app_${pub.getPSApplication().getPKGCodeName()}/app/vue.config.js ] if [ -e app_${pub.getPSApplication().getPKGCodeName()}/app/vue.config.js ]
then then
mv -f ${pub.getCodeName()?lower_case}-boot/src/main/docker/${pub.getCodeName()?lower_case}-app-${pub.getPSApplication().getPKGCodeName()}.yaml app_${pub.getPSApplication().getPKGCodeName()}/app/swarm.yaml
mv -f ${pub.getCodeName()?lower_case}-boot/src/main/docker/Dockerfile-APP app_${pub.getPSApplication().getPKGCodeName()}/app/Dockerfile
cd app_${pub.getPSApplication().getPKGCodeName()}/app cd app_${pub.getPSApplication().getPKGCodeName()}/app
else else
mv -f ${pub.getCodeName()?lower_case}-boot/src/main/docker/${pub.getCodeName()?lower_case}-app-${pub.getPSApplication().getPKGCodeName()}.yaml app_${pub.getPSApplication().getPKGCodeName()}/swarm.yaml
mv -f ${pub.getCodeName()?lower_case}-boot/src/main/docker/Dockerfile-APP app_${pub.getPSApplication().getPKGCodeName()}/Dockerfile
cd app_${pub.getPSApplication().getPKGCodeName()} cd app_${pub.getPSApplication().getPKGCodeName()}
fi fi
<#if depapp.getUserParam("dockerimage","")?? && depapp.getUserParam("dockerimage","")!=""> <#if depapp.getUserParam("dockerimage","")?? && depapp.getUserParam("dockerimage","")!="">
...@@ -93,8 +97,9 @@ TARGET=PSSYSTEM ...@@ -93,8 +97,9 @@ TARGET=PSSYSTEM
<#if pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="SWARM") > <#if pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="SWARM") >
sed -i "s#dstimage#$para5#g" swarm.yaml sed -i "s#dstimage#$para5#g" swarm.yaml
if [[ $para3 = all ]];then if [[ $para3 = all ]];then
mv Dockerfile-ALL Dockerfile
sed -i "s#/api#/<#if sys.getDeploySysId()??><#if (sys.getDeploySysId()?length gt 16)>${sys.getName()?lower_case}<#else>${sys.getDeploySysId()?lower_case}</#if><#else>${sys.getName()?lower_case}</#if>__${pub.getPSApplication().getPKGCodeName()?lower_case}#g" src/environments/environment.ts sed -i "s#/api#/<#if sys.getDeploySysId()??><#if (sys.getDeploySysId()?length gt 16)>${sys.getName()?lower_case}<#else>${sys.getDeploySysId()?lower_case}</#if><#else>${sys.getName()?lower_case}</#if>__${pub.getPSApplication().getPKGCodeName()?lower_case}#g" src/environments/environment.ts
sed -i "s#BaseUrl: ''#BaseUrl: '/<#if sys.getDeploySysId()??><#if (sys.getDeploySysId()?length gt 16)>${sys.getName()?lower_case}<#else>${sys.getDeploySysId()?lower_case}</#if><#else>${sys.getName()?lower_case}</#if>__${pub.getPSApplication().getPKGCodeName()?lower_case}'#g" src/environments/environment.ts
sed -i "s#BaseUrl: process.env.VUE_APP_BASEURL#BaseUrl: '/<#if sys.getDeploySysId()??><#if (sys.getDeploySysId()?length gt 16)>${sys.getName()?lower_case}<#else>${sys.getDeploySysId()?lower_case}</#if><#else>${sys.getName()?lower_case}</#if>__${pub.getPSApplication().getPKGCodeName()?lower_case}'#g" src/environments/environment.ts
sed -i "s#outputDir#//outputDir#g" vue.config.js sed -i "s#outputDir#//outputDir#g" vue.config.js
yarn yarn
ln -s /var/lib/jenkins/appcache/${depapp.getId()} node_modules/.cache ln -s /var/lib/jenkins/appcache/${depapp.getId()} node_modules/.cache
...@@ -114,7 +119,6 @@ TARGET=PSSYSTEM ...@@ -114,7 +119,6 @@ TARGET=PSSYSTEM
docker -H $para1 stack deploy --compose-file=swarm.yaml ${depplatform.getName()} --with-registry-auth docker -H $para1 stack deploy --compose-file=swarm.yaml ${depplatform.getName()} --with-registry-auth
<#elseif pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="K8S") > <#elseif pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="K8S") >
if [[ $para3 = all ]];then if [[ $para3 = all ]];then
mv Dockerfile-ALL Dockerfile
sed -i "s#/api#/<#if sys.getDeploySysId()??><#if (sys.getDeploySysId()?length gt 16)>${sys.getName()?lower_case}<#else>${sys.getDeploySysId()?lower_case}</#if><#else>${sys.getName()?lower_case}</#if>__${pub.getPSApplication().getPKGCodeName()?lower_case}#g" src/environments/environment.ts sed -i "s#/api#/<#if sys.getDeploySysId()??><#if (sys.getDeploySysId()?length gt 16)>${sys.getName()?lower_case}<#else>${sys.getDeploySysId()?lower_case}</#if><#else>${sys.getName()?lower_case}</#if>__${pub.getPSApplication().getPKGCodeName()?lower_case}#g" src/environments/environment.ts
sed -i "s#outputDir#//outputDir#g" vue.config.js sed -i "s#outputDir#//outputDir#g" vue.config.js
yarn yarn
...@@ -151,6 +155,9 @@ TARGET=PSSYSTEM ...@@ -151,6 +155,9 @@ TARGET=PSSYSTEM
cd ${pub.getCodeName()?lower_case}-boot cd ${pub.getCodeName()?lower_case}-boot
mvn ibizlabcli:code mvn ibizlabcli:code
cd .. cd ..
git add .
git cmmit -m "generator before deploy $para5"
git push origin master
mvn package -Pboot mvn package -Pboot
mvn install -Pboot mvn install -Pboot
<#if pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="SWARM") > <#if pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="SWARM") >
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册