简体   繁体   中英

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. I need to copy the files to the webserver and run a php script which setup the database.

I was thinking about using sshexec to run commands which will update the files and run the php script

<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)调用脚本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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