使用Apache Ant部署Web应用程序?
我只是能得到Apache Ant的我的电脑上运行。在蚂蚁-version
突击队输出的版本号,确认安装进展顺利。
I was just able to get Apache ANT running on my computer. The ant -version
commando outputs the version number , verifying that the installation went well.
我已阅读, ANT非常适合处理Web部署应用,包括PHP项目,并已花了一些时间去工作,但我就是不能让我围绕着如何将它设置为我的文件同步到我的Web服务器的头。
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同步 folderA
与 FolderB中
?
How can I make ANT sync folderA
with folderB
?
感谢
我最后一次检查(很久以前)有蚂蚁在没有远程同步任务(只的本地)。你将不得不的编写调用rsync的并的从蚂蚁执行这个代替。有一些远程任务虽然的。你可以从你的 VCS 的同步它代替到服务器。
Last time I checked (long ago) there was no remote sync task in Ant (only local). You would have to write a shell script that calls rsync and execute this from Ant instead. 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.
在阿里纳斯,你可能要考虑 Phing 的蚂蚁了。这是蚂蚁到PHP的端口。它有一个 FileSync任务。您也可以添加自己的任务(写在PHP)和PHP的持续集成服务器是常用的。
On a sidenote, you might want to consider Phing over Ant. It's a port of Ant to PHP. It has a FileSync Task. You can also add your own Tasks (written in PHP) and is commonly used in Continuous Integration servers for PHP.
另请参阅What是你的preferred部署策略为PHP 和夫妇别人的。