`
maypol
  • 浏览: 27037 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

ant 自动上传

    博客分类:
  • ant
阅读更多
<target name="upload" description="上传remote目录的内容到服务器上" >
        <!--登录到服务器,创建远程工作目录 -->
        <telnet server="${host}" userid="${username}" password="${password}" timeout="600">
            <read>${host.prompt}</read>
            <write>rm -r ${ci.remote.workdir}</write>
            <read>${host.prompt}</read>
            <write>mkdir -p ${ci.remote.workdir}</write>
            <read>${host.prompt}</read>
        </telnet>
       
        <!--使用FTP上传二进制文件到服务器 -->
        <ftp action="send" server="${host}" userid="${username}" password="${password}" remotedir="${ci.remote.workdir}" binary="yes">
            <fileset dir="${local.remote.dir}" >
                <exclude name="**/*.sh" />
                <exclude name="**/*.jsp" />
            </fileset>

        </ftp>

<!--下载tar.gz包-->

<ftp action="get" server="${host}" userid="${username}" password="${password}" remotedir="${host.remote.dir}/${basefilename}" binary="yes">
                <fileset dir="@{destdir}" includes="@{targzfile}" />
            </ftp>
</target>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics