简体   繁体   English

使用Apache ANT部署Web应用程序?

[英]Using Apache ANT to deploy web applications?

I was just able to get Apache ANT running on my computer. 我只能在我的计算机上运行Apache ANT。 The ant -version commando outputs the version number , verifying that the installation went well. ant -version突击队输出版本号,验证安装进展顺利。

I have read that ANT is well suited to handle deployment of web applications including PHP projects and have spent some time to get it working, but I just can't get my head around how to set it up to sync my files to my web server. 我已经读过ANT非常适合处理包括PHP项目在内的Web应用程序的部署 ,并且花了一些时间才能使它工作,但我无法理解如何设置它以将我的文件同步到我的Web服务器。

How can I make ANT sync folderA with folderB ? 如何使用folderB创建ANT sync folderA

Thanks 谢谢

Last time I checked (long ago) there was no remote sync task in Ant (only local ). 上次我检查(很久以前)Ant中没有远程同步任务(只有本地 )。 You would have to write a shell script that calls rsync and execute this from Ant instead. 您必须编写一个调用rsync的shell脚本,然后从Ant 执行此操作。 There is a number of remote tasks though. 但是有很多远程任务 And you could check out your code from your VCS instead of syncing it to the server. 您可以从VCS中检出代码,而不是将其同步到服务器。

On a sidenote, you might want to consider Phing over Ant. 在旁注中,您可能想要考虑Phing over Ant。 It's a port of Ant to PHP. 它是PHP的Ant端口。 It has a FileSync Task . 它有一个FileSync任务 You can also add your own Tasks (written in PHP) and is commonly used in Continuous Integration servers for PHP. 您还可以添加自己的任务(用PHP编写),并且常用于PHP的Continuous Integration服务器。

Also see What is your preferred Deployment Strategy for PHP and a couple others . 另请参阅什么是您首选的PHP部署策略其他几个

阅读手册: http//ant.apache.org/manual/index.html查看<copy>任务。

我本来想做同样的事情,刚刚看到这篇关于如何使用ant进行部署的文章,也许它会给你一个不同的方式来实现它: 使用Ant进行部署

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM