提交 d5b19cd8 编写于 作者: ibiz_zyy's avatar ibiz_zyy

支持Git分支

上级 8cea991a
......@@ -3,61 +3,23 @@ TARGET=PSSYSTEM
</#ibiztemplate>
<#if sysrun.getPSAppServer() ?? >
<#assign tomcatPath=sysrun.getPSAppServer().getAppFolder()?substring(0,(sysrun.getPSAppServer().getAppFolder()?length)-7)>
<#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.getPubSystemId()}</description>
<keepDependencies>false</keepDependencies>
<#if sys.getPSSVNInstRepo()?? && sys.getPSSVNInstRepo().getSVNType() =="SVN">
<scm class="hudson.scm.SubversionSCM" plugin="subversion@2.10.5">
<locations>
<hudson.scm.SubversionSCM_-ModuleLocation>
<remote>${sys.getReadOnlyPSSVNInstRepo().getConnStr()}/${sys.getPSDevSlnCodeName()}/${sys.getTrunkSysName()}/${sys.getVCName()}</remote>
<credentialsId>${sys.getPubSystemId()}</credentialsId>
<local>pub</local>
<depthOption>infinity</depthOption>
<ignoreExternalsOption>false</ignoreExternalsOption>
<cancelProcessOnExternalsFail>false</cancelProcessOnExternalsFail>
</hudson.scm.SubversionSCM_-ModuleLocation>
<hudson.scm.SubversionSCM_-ModuleLocation>
<remote>${sys.getPSSVNInstRepo().getConnStr()}/${sys.getPSDevSlnCodeName()}/${sys.getTrunkSysName()}/${sys.getVCName()}</remote>
<credentialsId>${sys.getPubSystemId()}</credentialsId>
<local>usr</local>
<depthOption>infinity</depthOption>
<ignoreExternalsOption>false</ignoreExternalsOption>
<cancelProcessOnExternalsFail>false</cancelProcessOnExternalsFail>
</hudson.scm.SubversionSCM_-ModuleLocation>
</locations>
<excludedRegions></excludedRegions>
<includedRegions></includedRegions>
<excludedUsers></excludedUsers>
<excludedRevprop></excludedRevprop>
<excludedCommitMessages></excludedCommitMessages>
<workspaceUpdater class="hudson.scm.subversion.UpdateUpdater"/>
<ignoreDirPropChanges>false</ignoreDirPropChanges>
<filterChangelog>false</filterChangelog>
<quietOperation>false</quietOperation>
</scm>
<#elseif sys.getPSSVNInstRepo().getSVNType()=="GIT">
<scm class="hudson.plugins.git.GitSCM" plugin="git@3.8.0">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>${sys.getPSSVNInstRepo().getGitPath()}</url>
<credentialsId>dev_ibizsys</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions/>
</scm>
</#if>
<canRoam>false</canRoam>
<properties>
<com.gitee.jenkins.connection.GiteeConnectionProperty plugin="gitee@1.1.3">
<giteeConnection></giteeConnection>
</com.gitee.jenkins.connection.GiteeConnectionProperty>
</properties>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
......@@ -67,6 +29,9 @@ TARGET=PSSYSTEM
<hudson.tasks.Shell>
<command>
source /etc/profile
rm -rf ${pub.codeName}
git clone -b ${branch} ${sys.getPSSVNInstRepo().getGitPath()} ${pub.codeName}
cd ${pub.codeName}
echo &apos;echo &apos;${sysrun.getPSAppServer().getRemotePassword()} &gt; apppasswd.sh
chmod -R 777 *
sed -i &quot;s/\r//&quot; `find ./ -name &quot;*.sh&quot;`
......@@ -79,16 +44,29 @@ mvn clean install
cd ./srv_${pub.codeName}/target/
mv srv_${pub.codeName}-1.0.0.0 ${pub.codeName}
zip -r ${pub.codeName}.zip ${pub.codeName}
setsid env SSH_ASKPASS=&apos;../../apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh appuser@172.16.102.17 &quot;rm -rf /app/apache-tomcat-8083/webapps/${pub.codeName}*&quot;
setsid env SSH_ASKPASS=&apos;../../apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; scp -r ${pub.codeName}.zip appuser@172.16.102.17:/app/apache-tomcat-8083/webapps/
setsid env SSH_ASKPASS=&apos;../../apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh appuser@172.16.102.17 &quot;unzip /app/apache-tomcat-8083/webapps/${pub.codeName}.zip -d /app/apache-tomcat-8083/webapps/;/app/apache-tomcat-8083/bin/shutdown.sh;ps -ef | grep &apos;/app/apache-tomcat-8083/&apos;| tr -s &apos; &apos;|cut -d&apos; &apos; -f2,8,9 | grep &apos;/app/apache-tomcat-8083/&apos; | cut -d&apos; &apos; -f1|xargs --no-run-if-empty kill -9;/app/apache-tomcat-8083/bin/startup.sh&quot;
setsid env SSH_ASKPASS=&apos;../../apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh ${sysrun.getPSAppServer().getRemoteUserName()}@${sysrun.getPSAppServer().getRemoteAddress()} &quot;rm -rf ${tomcatPath}webapps/${pub.codeName}*&quot;
setsid env SSH_ASKPASS=&apos;../../apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; scp -r ${pub.codeName}.zip ${sysrun.getPSAppServer().getRemoteUserName()}@${sysrun.getPSAppServer().getRemoteAddress()}:${tomcatPath}webapps/
setsid env SSH_ASKPASS=&apos;../../apppasswd.sh&apos; DISPLAY=&apos;none:0&apos; ssh ${sysrun.getPSAppServer().getRemoteUserName()}@${sysrun.getPSAppServer().getRemoteAddress()} &quot;unzip ${tomcatPath}webapps/${pub.codeName}.zip -d ${tomcatPath}webapps/;${tomcatPath}bin/shutdown.sh;ps -ef | grep &apos;${tomcatPath}&apos;| tr -s &apos; &apos;|cut -d&apos; &apos; -f2,8,9 | grep &apos;${tomcatPath}&apos; | cut -d&apos; &apos; -f1|xargs --no-run-if-empty kill -9;${tomcatPath}bin/startup.sh&quot;
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<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>
<com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
</buildWrappers>
<com.michelin.cio.hudson.plugins.maskpasswords.MaskPasswordsBuildWrapper/>
</buildWrappers>
</project>
</#if>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册