繁体   English   中英

如何使用ant和git将php应用程序部署到实时Web服务器

[英]How to deploy php application to a live web server using ant and git

我需要一个可以使用ant和git将php应用程序部署到Web服务器的解决方案。 我需要将文件复制到Web服务器并运行一个php脚本来设置数据库。

我正在考虑使用sshexec运行将更新文件并运行php脚本的命令

<target name="deploy">
    <sshexec host="host"
         port="22"
         username="user"
         password="****"
         trust="true"
         command="..."/>
</target>

有人有完整的解决方案吗? 甚至更好的解决方案?

如果您需要定期将更改的文件集复制到服务器并在每次更新后执行已知的脚本,则可以使用git push进行复制,以及使用post-receive git钩子(http://book.git-scm.com /5_git_hooks.html)调用脚本。

暂无
暂无

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

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