我有一个 Ant 脚本,每次需要部署应用程序时都会执行 CVS-checkout。执行此操作的理想方法是先删除现有的本地代码,然后进行结帐,但似乎我无法删除该项目,因为我的构建文件也是其中的一部分。所以我想做一个检查,我现有的文件将被存储库中的文件替换。有没有办法强制 cvs checkout 覆盖现有文件?
我的构建目标看起来像
<target name="deploy.branch" depends="checkPropertyForBranch" if="branchPropertyExist">
<record name="log.txt" action="start" />
<echo message="${release.number}" />
<antcall target="tag.branch" />
<antcall target="checkout.branch" />
<antcall target="stopJboss" />
<antcall target="stopRemoteJboss" />
<sleep seconds="10" />
<antcall target="replaceTag" />
<antcall target="deploy" />
<antcall target="moveConfigFiles" />
<antcall target="promote" />
<parallel>
<antcall target="startJboss" />
<antcall target="startRemoteJboss" />
</parallel>
<antcall target="waitForWebSite" />
<antcall target="mailSuccessBranch" />
<record name="log.txt" action="stop" />
</target>
结帐目标就像
<target name="checkout.branch">
<tstamp>
<format property="CHECKOUT" pattern="M/d/yyyy, hh:mm:SS a, z" locale="en" />
</tstamp>
<property name="checkout_start" value="${CHECKOUT}" />
<echo message="CVS checkout of BRANCH: ${branch_tag}" />
<!--<delete dir="${basedir}"/>-->
<cvspass cvsroot="cvsroot" password="*****" />
<cvs cvsroot="cvsroot" command="co -r ${branch_tag} project"dest="${checkout.dir}" />
</target>
build.xml 出现在project/scripts/build.xml
Where the basedir
is../
即"project"