[英]How to deploy php application to a live web server using ant and git
I need a solution that I can deploy php application to a webserver using ant and git. 我需要一个可以使用ant和git将php应用程序部署到Web服务器的解决方案。 I need to copy the files to the webserver and run a php script which setup the database.
我需要将文件复制到Web服务器并运行一个php脚本来设置数据库。
I was thinking about using sshexec to run commands which will update the files and run the php script 我正在考虑使用sshexec运行将更新文件并运行php脚本的命令
<target name="deploy">
<sshexec host="host"
port="22"
username="user"
password="****"
trust="true"
command="..."/>
</target>
Does anyone has the complete solution? 有人有完整的解决方案吗? or even a better solution?
甚至更好的解决方案?
如果您需要定期将更改的文件集复制到服务器并在每次更新后执行已知的脚本,则可以使用git push
进行复制,以及使用post-receive
git钩子(http://book.git-scm.com /5_git_hooks.html)调用脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.