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

init

上级 19191625
*volumes
*target
.settings
*node_modules
*bin
*.project
*.classpath
*.factorypath
.history
.idea
**.iml
*.jar
*.log
.DS_Store
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
*volumes
*target
.settings
*node_modules
*bin
*.project
*.classpath
*.factorypath
.history
.idea
**.iml
*.jar
*.log
.DS_Store
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
type: PSSYSTEM
psdevsln: ${sys.getPSDevSlnId()}
psdevslnsys: ${sys.getPubSystemId()}
psdevslnsysname: ${sys.getLogicName()}
<#if sys.getPSSVNInstRepo?? && sys.getPSSVNInstRepo()?? && sys.getPSSVNInstRepo().getGitPath?? && sys.getPSSVNInstRepo().getGitPath()??>
git-remote: ${sys.getPSSVNInstRepo().getGitPath()}
<#else>
# 需自行补充 git-remote 参数,值为 git 地址
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#if pub.getPSDeployCenter()?? && sysrun.getRunMode()??>
<#if pub.getPSDeployCenter().getCIType()?? && (pub.getPSDeployCenter().getCIType()=="JENKINS") >
<#if sysrun.getRunMode() == "STARTMSAPI">
<#assign depapi = sysrun.getPSDevSlnMSDepAPI()>
<#assign configId = depapi.getId()>
<#assign config = "api"+depapi.getName()>
<#assign depnode = sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatformNode()>
<#assign depplatform = sysrun.getPSDevSlnMSDepAPI().getPSDCMSPlatform()>
<#elseif sysrun.getRunMode() == "STARTMSAPP">
<#assign depapp = sysrun.getPSDevSlnMSDepApp()>
<#assign configId = depapp.getId()>
<#assign config = "app"+depapp.getName()>
<#assign depnode = sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatformNode()>
<#assign depplatform = sysrun.getPSDevSlnMSDepApp().getPSDCMSPlatform()>
</#if>
<#if sys.getPSSVNInstRepo().getGitBranch()?? && sys.getPSSVNInstRepo().getGitBranch()!="">
<#assign branch=sys.getPSSVNInstRepo().getGitBranch()>
<#else>
<#assign branch='master'>
</#if>
<?xml version='1.1' encoding='UTF-8'?>
<project>
<actions/>
<description>${sys.codeName}</description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>para1</name>
<description></description>
<defaultValue>para1</defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>para2</name>
<description></description>
<defaultValue>para2</defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>para3</name>
<description></description>
<defaultValue>para3</defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>para4</name>
<description></description>
<defaultValue>para4</defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>para5</name>
<description></description>
<defaultValue>para5</defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.Shell>
<command>
BUILD_ID=DONTKILLME
source /etc/profile
rm -rf ${sys.codeName?lower_case}
git clone -b ${branch} $para2 ${sys.codeName?lower_case}/
export NODE_OPTIONS=--max-old-space-size=4096
cd ${sys.codeName?lower_case}/
<#if sysrun.getRunMode() == "STARTMSAPP">
mkdir -p /var/lib/jenkins/appcache/${depapp.getId()}
if [ -e app_${pub.getPSApplication().getPKGCodeName()}/.dynamic ]
then
cd app_${pub.getPSApplication().getPKGCodeName()}
else
cd app_${pub.getPSApplication().getPKGCodeName()}/app
fi
<#if depapp.getUserParam("dockerimage","")?? && depapp.getUserParam("dockerimage","")!="">
sed -i "s#dstimage#${depapp.getUserParam("dockerimage","")}#g" swarm.yaml
docker -H $para1 stack deploy --compose-file=swarm.yaml ${depplatform.getName()} --with-registry-auth
<#else>
<#if pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="SWARM") >
sed -i "s#dstimage#$para5#g" swarm.yaml
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#outputDir#//outputDir#g" vue.config.js
yarn
ln -s /var/lib/jenkins/appcache/${depapp.getId()} node_modules/.cache
yarn build
else
if [ -e .dynamic ]
then
mv <#if pub?? && pub.getModelFolder?? && pub.getModelFolder()??> ../${pub.getModelFolder()}/PSSYSAPPS/${pub.getPSApplication().getCodeName()}</#if> model
else
mv <#if pub?? && pub.getModelFolder?? && pub.getModelFolder()??> ../../${pub.getModelFolder()}/PSSYSAPPS/${pub.getPSApplication().getCodeName()}</#if> model
fi
sed -i "s#srcimagename#$para4#g" Dockerfile-MODEL
mv Dockerfile-MODEL Dockerfile
fi
docker build -t $para5 .
docker push $para5
docker -H $para1 stack deploy --compose-file=swarm.yaml ${depplatform.getName()} --with-registry-auth
<#elseif pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="K8S") >
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#outputDir#//outputDir#g" vue.config.js
yarn
ln -s /var/lib/jenkins/appcache/${depapp.getId()} node_modules/.cache
yarn build
else
if [ -e .dynamic ]
then
mv <#if pub?? && pub.getModelFolder?? && pub.getModelFolder()??> ../${pub.getModelFolder()}/PSSYSAPPS/${pub.getPSApplication().getCodeName()}</#if> model
else
mv <#if pub?? && pub.getModelFolder?? && pub.getModelFolder()??> ../../${pub.getModelFolder()}/PSSYSAPPS/${pub.getPSApplication().getCodeName()}</#if> model
fi
sed -i "s#srcimagename#$para4#g" Dockerfile-MODEL
mv Dockerfile-MODEL Dockerfile
fi
docker build -t $para5 .
docker push $para5
<#else>
echo &apos;echo &quot;$para1&quot;&apos; &gt; apppasswd.sh
chmod -R 777 *
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} &quot;mkdir -p ${depnode.getWorkshopPath()}/${configId}&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; scp -r ${pub.getCodeName()?lower_case}-app-${pub.getPSApplication().getPKGCodeName()?lower_case}.jar ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()}:${depnode.getWorkshopPath()}/${configId}
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} &quot;ps -ef | grep &apos;${depnode.getWorkshopPath()}/${configId}&apos;| tr -s &apos; &apos;|cut -d&apos; &apos; -f2,8,9 | grep -v grep | grep &apos;jar&apos; | cut -d&apos; &apos; -f1|xargs --no-run-if-empty kill -9&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} &quot;source /etc/profile;source ~/.bash_profile; nohup java -jar -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=128m ${depnode.getWorkshopPath()}/${configId}/${pub.getCodeName()?lower_case}-app-${pub.getPSApplication().getPKGCodeName()?lower_case}.jar &gt;&gt;${depnode.getWorkshopPath()}/${configId}/${sys.codeName?lower_case}_${config?lower_case}-`date --date=&apos;0 days ago&apos; +%Y-%m-%d`.log 2&gt;&amp;1 &amp;&quot;
</#if>
</#if>
</#if>
<#if sysrun.getRunMode() == "STARTMSAPI">
<#if depapi.getUserParam("dockerimage","")?? && depapi.getUserParam("dockerimage","")!="">
cd ${pub.getCodeName()?lower_case}-boot
docker -H $para1 stack deploy --compose-file=src/main/docker/${pub.getCodeName()?lower_case}-boot-${pub.getPSSysServiceAPI().getCodeName()?lower_case}.yaml ${depplatform.getName()} --with-registry-auth
<#else>
mvn clean package -P${pub.getPSSysServiceAPI().getCodeName()?lower_case}
mvn install -P${pub.getPSSysServiceAPI().getCodeName()?lower_case}
<#if pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="SWARM") >
cd ${pub.getCodeName()?lower_case}-boot
<#if depapi.getUserParam("multiplatform","")?? && depapi.getUserParam("multiplatform","")=="true">
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} exec:exec@prepare
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} exec:exec@buildpush
<#else>
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} docker:build
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} docker:push
</#if>
docker -H $para1 stack deploy --compose-file=src/main/docker/${pub.getCodeName()?lower_case}-boot-${pub.getPSSysServiceAPI().getCodeName()?lower_case}.yaml ${depplatform.getName()} --with-registry-auth
<#elseif pub.getPSDeployCenter().getCDType()?? && (pub.getPSDeployCenter().getCDType()=="K8S") >
cd ${pub.getCodeName()?lower_case}-boot
<#if depapi.getUserParam("multiplatform","")?? && depapi.getUserParam("multiplatform","")=="true">
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} exec:exec@prepare
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} exec:exec@buildpush
<#else>
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} docker:build
mvn -P${pub.getPSSysServiceAPI().getCodeName()?lower_case} docker:push
</#if>
set +e
kubectl --kubeconfig ~/shanghai-demo-01 delete -f src/main/docker/${pub.getCodeName()?lower_case}-boot-${pub.getPSSysServiceAPI().getCodeName()?lower_case}-k8s.yaml -n ${depplatform.getName()?lower_case}
set -e
kubectl --kubeconfig ~/shanghai-demo-01 create -f src/main/docker/${pub.getCodeName()?lower_case}-boot-${pub.getPSSysServiceAPI().getCodeName()?lower_case}-k8s.yaml -n ${depplatform.getName()?lower_case}
<#else>
echo &apos;echo &quot;$para1&quot;&apos; &gt; apppasswd.sh
chmod -R 777 *
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} &quot;mkdir -p ${depnode.getWorkshopPath()}/${configId}&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; scp -r ${pub.getCodeName()?lower_case}-boot-${pub.getPSSysServiceAPI().getCodeName()?lower_case}.jar ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()}:${depnode.getWorkshopPath()}/${configId}
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} &quot;ps -ef | grep &apos;${depnode.getWorkshopPath()}/${configId}&apos;| tr -s &apos; &apos;|cut -d&apos; &apos; -f2,8,9 | grep -v grep | grep &apos;jar&apos; | cut -d&apos; &apos; -f1|xargs --no-run-if-empty kill -9&quot;
setsid env SSH_ASKPASS=&apos;./apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh ${depnode.getSSHUserName()}@${depnode.getSSHIPAddr()} &quot;source /etc/profile;source ~/.bash_profile; nohup java -jar -Xms512m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=128m ${depnode.getWorkshopPath()}/${configId}/${pub.getCodeName()?lower_case}-boot-${pub.getPSSysServiceAPI().getCodeName()?lower_case}.jar &gt;&gt;${depnode.getWorkshopPath()}/${configId}/${sys.codeName?lower_case}_${config?lower_case}-`date --date=&apos;0 days ago&apos; +%Y-%m-%d`.log 2&gt;&amp;1 &amp;&quot;
</#if>
</#if>
</#if>
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup@0.34">
<patterns class="empty-list"/>
<deleteDirs>false</deleteDirs>
<skipWhenFailed>false</skipWhenFailed>
<cleanWhenSuccess>true</cleanWhenSuccess>
<cleanWhenUnstable>true</cleanWhenUnstable>
<cleanWhenFailure>true</cleanWhenFailure>
<cleanWhenNotBuilt>true</cleanWhenNotBuilt>
<cleanWhenAborted>true</cleanWhenAborted>
<notFailBuild>false</notFailBuild>
<cleanupMatrixParent>false</cleanupMatrixParent>
<externalDelete></externalDelete>
</hudson.plugins.ws__cleanup.WsCleanup>
</publishers>
<buildWrappers/>
</project>
</#if>
</#if>
<#comment>替换参数驼峰命名</#comment>
<#function srfr7templcaseformat codeName>
<#assign result = codeName>
<#if result!=''>
<#if ((pub.getPSSFStyleParam().getStyleParam("camelCase",""))!'') == "true">
<#if result?matches("^[A-Z_]{3}\\w*")>
<#assign result = result?lower_case>
</#if>
<#assign result = srfcaseformat(result,'UC2l_u')>
<#assign result = srfcaseformat(result,'l_u2lC')>
<#else>
<#assign result = srfcaseformat(result,'l_u2lC')>
</#if>
</#if>
<#return result>
</#function>
<#-- 获取行为返回值类型 -->
<#function getActionResult action>
<#assign returnType = action.getPSDEActionReturn().getType()/>
<#if returnType == 'DTO'>
<#assign result>IEntityDTO</#assign>
<#elseif returnType == 'DTOS'>
<#assign result>List<IEntityDTO></#assign>
<#elseif returnType == 'SIMPLE'>
<#assign result>String</#assign>
<#elseif returnType == 'SIMPLES'>
<#assign result>List<String></#assign>
<#else>
<#assign result>void</#assign>
</#if>
<#return result>
</#function>
\ No newline at end of file
%DEDQ_FIELDCOND%=\
<#if cond.getPSVARTypeId()?? && (cond.getPSVARTypeId()?length gt 0)> \
<#if cond.isIgnoreEmpty()> \
<#noparse><choose><when test="#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>} !=null "></#noparse> \
</#if> \
${field} \
<#if cond.getPSDBValueOPId() == 'EQ' >\
<#noparse>=</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'ABSEQ' >\
<#noparse>=</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'GT' >\
<#noparse>></#noparse> \
<#elseif cond.getPSDBValueOPId() == 'GTANDEQ' >\
<#noparse>>=</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'LT' >\
<#noparse><</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'LTANDEQ' >\
<#noparse><=</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'NOTEQ' >\
<#noparse><></#noparse> \
<#elseif cond.getPSDBValueOPId() == 'ISNULL' >\
<#noparse>IS NULL</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'ISNOTNULL' >\
<#noparse>IS NOT NULL</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'USERLIKE' >\
<#noparse>LIKE</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'LIKE' >\
<#noparse>LIKE</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'LEFTLIKE' >\
<#noparse>LIKE</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'RIGHTLIKE' >\
<#noparse>LIKE</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'TESTNULL' >\
# <#noparse>!=</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'IN' >\
<#noparse>IN</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'NOTIN' >\
<#noparse>NOT IN</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'CHILDOF' >\
# <#noparse>!=</#noparse> \
<#elseif cond.getPSDBValueOPId() == 'PARENTOF' >\
# <#noparse>!=</#noparse> \
</#if>\
<#if cond.getCondValue()?? && (cond.getCondValue()?length gt 0)>\
<#if cond.getPSDBValueOPId() == 'LIKE'>\
<#if dbtype == 'MYSQL5'>\
<#noparse>CONCAT('%',#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>},'%')</#noparse> \
<#elseif dbtype == 'ORACLE'>\
<#noparse>'%' || #{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>} || '%'</#noparse> \
<#else>\
<#noparse>#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>}</#noparse> \
</#if>\
<#elseif cond.getPSDBValueOPId() == 'USERLIKE'>\
<#if dbtype == 'MYSQL5'>\
<#noparse>CONCAT('%',#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>},'%')</#noparse> \
<#elseif dbtype == 'ORACLE'>\
<#noparse>'%' || #{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>} || '%'</#noparse> \
<#else>\
<#noparse>#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>}</#noparse> \
</#if>\
<#elseif cond.getPSDBValueOPId() == 'LEFTLIKE' >\
<#if dbtype == 'MYSQL5'>\
<#noparse>CONCAT('%',#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>})</#noparse> \
<#elseif dbtype == 'ORACLE'>\
<#noparse>'%' || #{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>}</#noparse> \
<#else>\
<#noparse>#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>}</#noparse> \
</#if>\
<#elseif cond.getPSDBValueOPId() == 'RIGHTLIKE' >\
<#if dbtype == 'MYSQL5'>\
<#noparse>CONCAT(#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>},'%')</#noparse> \
<#elseif dbtype == 'ORACLE'>\
<#noparse>#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>} || '%'</#noparse> \
<#else>\
<#noparse>#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>}</#noparse> \
</#if>\
<#elseif cond.getPSDBValueOPId() == 'IN' >\
<#noparse>({ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>})</#noparse> \
<#else>\
<#noparse>#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.${cond.getCondValue()?lower_case}<#noparse>}</#noparse> \
</#if>\
<#else>\
<#noparse>#{ctx.</#noparse>${cond.getPSVARTypeId()?lower_case}.unknown<#noparse>}</#noparse> \
</#if>\
<#if cond.isIgnoreEmpty()> \
<#noparse><otherwise>1=1</otherwise></choose></#noparse> \
</#if> \
<#else>\
${code}\
</#if>\
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册