Using Apache ANT to deploy web applications?

2019-05-13 02:21发布

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

3条回答
你好瞎i
2楼-- · 2019-05-13 02:33

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

查看更多
冷血范
3楼-- · 2019-05-13 02:45

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.

查看更多
forever°为你锁心
4楼-- · 2019-05-13 02:46

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

查看更多
登录 后发表回答