前端部署ant+yuicompressor檔案壓縮+擷取版本號碼+SSH發布(部分代碼)

來源:互聯網
上載者:User

標籤:ant   前端   

檔案壓縮:

<apply executable="java" parallel="false" failonerror="true" dest="../../release/publish/ecshop" append="false" force="true">    <fileset dir="../../release/publish/ecshop">    </fileset>    <arg line="-jar" />    <arg path="${compressor}" />    <arg line="--charset utf8" />    <srcfile />    <arg line="-o" />    <mapper type="glob" from="*.js" to="*.js" />    <targetfile /></apply>

SSH發

<scp todir="${username_c}:${password_c}@${host_c}://usr/rete"  trust="true">    <fileset dir='../../release/${version}/test/2兒童/'>        <exclude name="${conf}" />        <exclude name="${Runtime}" />        <exclude name="${nbproject}" />    </fileset></scp>

通過SVN info擷取SVN版本號碼通過調用cmd命令列,擷取SVN版本,存放到buildRevision檔案中,然後再引進buildRevision這個檔案。讀取版本號碼的值。

<echo level="info" message="正在擷取指定目錄的版本號碼..." />       <exec dir = "${svnurl}" executable = "svn.exe" output = "buildRevision">           <arg line = "info" />           <redirector>               <outputfilterchain>                   <linecontainsregexp>                       <regexp pattern="^Revision:"/>                   </linecontainsregexp>                   <tokenfilter>                       <replaceregex pattern="Revision\:\s*" flags="s" replace="Revision="/>                   </tokenfilter>               </outputfilterchain>           </redirector>       </exec>       <property file="buildRevision" />       <property file="buildRevision_Inherit" />       <echo  message="擷取成功,版本號碼是${Revision}"/>       <echo level="info" message="正在產生發布指定目錄..." />

其中
<redirector>      <outputfilterchain>          <linecontainsregexp>              <regexp pattern="^Revision:"/>          </linecontainsregexp>          <tokenfilter>              <replaceregex pattern="Revision\:\s*" flags="s" replace="Revision="/>          </tokenfilter>      </outputfilterchain>  </redirector>

這個的意思是過濾掉SVNINFO命令列中其他,只留下Revision=版本號碼

然後再引進就可以了。


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.