简体   繁体   English

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

[英]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.

相关问题 使用Jenkins,git和eb cli在Elastic Beanstalk上部署php Web应用程序 - Deploy php web application on Elastic Beanstalk using Jenkins, git and eb cli 使用Apache ANT部署Web应用程序? - Using Apache ANT to deploy web applications? 如何使用PHP在Live Server中创建目录? - How to create a directory in Live Server using PHP? 如何使用.htaccess权限在子域中部署PHP Web应用程序 - How can i deploy a PHP web application in subdomain using .htaccess permission 如何将我的 ReactJS web 应用程序部署到生产服务器 - How to deploy my ReactJS web application to Production Server 使用 Web 服务器和 PHP 在计算机上打开应用程序 - Open application on computer using web server and PHP 在Web应用程序服务器(php)中使用maptlotlib出现问题 - Trouble using maptlotlib in web application server (php) 将PHP Web应用程序部署到共享Web服务器上并保护我的代码不被读取 - Deploy a PHP web application onto a shared web server and protect my code from being read 如何使用Docker在Alpine Linux上部署Laravel Web应用程序? - How to deploy a Laravel Web Application on Alpine Linux using Docker? 将实时php应用程序移动到本地服务器沼泽 - moving live php application to local server wamp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM