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

发布于 2024-10-03 17:58:58 字数 335 浏览 4 评论 0 原文

我刚刚能够在我的计算机上运行 Apache ANT。 ant -version 命令行输出版本号,验证安装是否顺利。

我读到 ANT 非常适合处理包括 PHP 在内的 Web 应用程序的部署项目并花了一些时间让它工作,但我就是不知道如何设置它以将我的文件同步到我的网络服务器。

如何使 ANT 同步 folderAfolderB

谢谢

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.

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.

How can I make ANT sync folderA with folderB ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我一向站在原地 2024-10-10 17:58:58

上次我检查(很久以前)Ant 中没有远程同步任务(只有 本地< /a>)。您必须 改为从 Ant 执行。不过,有许多远程任务。您可以从 VCS 查看代码,而不是将其同步到服务器。

顺便说一句,您可能需要考虑 Phing 而不是 Ant。它是 Ant 到 PHP 的端口。它有一个 FileSync 任务。您还可以添加自己的任务(用 PHP 编写),通常用于 PHP 的持续集成服务器。

另请参阅您首选的 PHP 部署策略耦合其他

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.

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.

Also see What is your preferred Deployment Strategy for PHP and a couple others.

猥︴琐丶欲为 2024-10-10 17:58:58

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

Read the manual: http://ant.apache.org/manual/index.html
Look at the <copy> task.

番薯 2024-10-10 17:58:58

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

I was looking to do the same and just came across this article on how to deploy using ant, maybe it'll give you a different way of going about it: Deploying using Ant

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文