ant shell 实现增量减量部署.docx

上传人:b****6 文档编号:5870135 上传时间:2023-01-01 格式:DOCX 页数:4 大小:15.07KB
下载 相关 举报
ant shell 实现增量减量部署.docx_第1页
第1页 / 共4页
ant shell 实现增量减量部署.docx_第2页
第2页 / 共4页
ant shell 实现增量减量部署.docx_第3页
第3页 / 共4页
ant shell 实现增量减量部署.docx_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

ant shell 实现增量减量部署.docx

《ant shell 实现增量减量部署.docx》由会员分享,可在线阅读,更多相关《ant shell 实现增量减量部署.docx(4页珍藏版)》请在冰豆网上搜索。

ant shell 实现增量减量部署.docx

antshell实现增量减量部署

antshell实现增量减量部署

<copytodir="${add.dir}"verbose="false"failonerror="false"preservelastmodified="false"includeemptydirs="false"><filesetdir="${build.dir}">

<differenttargetdir="${old.dir}"ignoreFileTimes="true"/>

<presentpresent="both"targetdir="${old.dir}"/>

</fileset>

<filesetdir="${build.dir}">

<differenttargetdir="${old.dir}"ignoreFileTimes="true"/>

<presentpresent="srconly"targetdir="${old.dir}"/>

</fileset>

</copy>

<copytodir="${del.dir}"verbose="false"failonerror="false"preservelastmodified="false"includeemptydirs="false"><filesetdir="${old.dir}">

<differenttargetdir="${build.dir}"ignoreFileTimes="true"/>

<presentpresent="srconly"targetdir="${build.dir}"/>

</fileset>

</copy>

<sleepseconds="2"/>

<availablefile="../add"property="add.dir_exist"/>

<availablefile="../del"property="del.dir_exist"/>

<sleepseconds="1"/>

</target>复制代码判断是否要备份生产环境的该项目<targetname="needbak">

<conditionproperty="needbakup">

<or>

<issetproperty="add.dir_exist"/>

<issetproperty="del.dir_exist"/>

</or>

</condition>

<sleepseconds="1"/>

</target>

<targetname="bak_remote"if="needbakup">

<tstamp>

<formatproperty="DSTAMP"pattern="yyyyMMdd'T'HHmmss"/>

</tstamp>

<sshexechost="10.100.31.80"username="root"port="22"password=""command="zip-r/home/${project.name}-${DSTAMP}.zip${remote.dir}"trust="yes"/>

</target>复制代码将找到的需要删除的文件,修改为生产环境的路径,需要增加的文件,压缩为zip包<targetname="runsh"if="del.dir_exist">

<execexecutable="/bin/sh">

<argvalue="/home/dellist.sh"/>

<argvalue="s/^del/\/home\/tomcat\/webapps\/AMS/g"/>

</exec>

<sleepseconds="2"/>

</target><targetname="zip_package"if="add.dir_exist">

<zipdestfile="../add.zip"basedir="../add"/>

<sleepseconds="2"/>

<antcalltarget="addfile_scp"/>

</target>复制代码执行变更<targetname="del_remote"if="del.dir_exist">

<antcalltarget="delfile_scp"/>

</target>

<targetname="addfile_scp">

<scpfile="../add.zip"port="22"todir="root:

test@123@10.100.31.80:

/home"trust="yes"/>

<sshexechost="10.100.31.80"username="root"port="22"password="test@123"command="unzip-o/home/add.zip-d${remote.dir}"trust="yes"/>

</target><targetname="delfile_scp">

<scpfile="../del.txt"port="22"todir="root:

test@123@10.100.31.80:

/home"trust="yes"/>

<sshexechost="10.100.31.80"username="root"port="22"password="test@123"command="rm-f`cat/home/del.txt`"trust="yes"/>

</target>复制代码上传不了图片=。

=贴个jenkins的执行日志

clean:

prepare:

compile:

increment:

[copy]Copying14filesto/home/jenkins/jobs/test/workspace/add

[copy]Copying2filesto/home/jenkins/jobs/test/workspace/del

needbak:

bak_remote:

[sshexec]Connectingto10.100.31.80:

22

[sshexec]cmd:

zip-r/home/AMS-20130415T153408.zip/home/tomcat/webapps/AMS

[sshexec]adding:

home/tomcat/webapps/AMS/

[sshexec](stored0%)

[sshexec]adding:

home/tomcat/webapps/AMS/META-INF/(stored0%)

[sshexec]adding:

home/tomcat/webapps/AMS/META-INF/MANIFEST.MF

[sshexec](stored0%)runsh:

[exec]needdelfilefoundzip_package:

[zip]Buildingzip:

/home/jenkins/jobs/test/workspace/add.zipaddfile_scp:

[scp]Connectingto10.100.31.80:

22

[scp]done.

[sshexec]Connectingto10.100.31.80:

22

[sshexec]cmd:

unzip-o/home/add.zip-d/home/tomcat/webapps/AMS

[sshexec]Archive:

/home/add.zip

[sshexec]creating:

/home/tomcat/webapps/AMS/WEB-INF/page/ExtJs/app/period1/DataExtract/

[sshexec]inflating:

/home/tomcat/webapps/AMS/WEB-INF/classes/com/creditease/app/ams/period1/AMSConst.class

[sshexec]

[sshexec]inflating:

/home/tomcat/webapps/AMS/WEB-INF/classes/com/creditease/app/ams/period1/action/extjs/DataExtractAction.classdel_remote:

delfile_scp:

[scp]Connectingto10.100.31.80:

22

[scp]done.

[sshexec]Connectingto10.100.31.80:

22

[sshexec]cmd:

rm-f`cat/home/del.txt`bak:

[zip]Buildingzip:

/home/jenkins/jobs/test/workspace/build.zipincrement_all:

BUILDSUCCESSFUL

Totaltime:

1minute6seconds

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 自然科学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1