多台服务器集群, 如何使用git自动部署代码
淡淡烟草味
淡淡烟草味 2017-05-02 09:29:33
0
6
1618

我们用git托管代码, 线上有多台服务器, 求代码自动部署同步所有服务器的方法;

希望提供较详细的方案信息, 谢谢!

淡淡烟草味
淡淡烟草味

reply all(6)
滿天的星座

Don’t deploy code like this. Synchronization cannot be guaranteed with git pull, and what should I do if the pull fails on a machine? It is recommended to use a separate deployment machine to pull the code and incrementally synchronize it to the server. You can use ansible

刘奇

First of all, I want to know whether you place the origin bare library on a certain server online, or whether you treat these online servers as clients that clone code from origin.
Secondly, online servers can do the following things to achieve automated deployment: 1. Add hook actions to git. Every time git completes an action, the corresponding action can be executed through the hook; 2. Use Linux corntab and shell scripts can perform some checks regularly, or perform some git updates regularly; 3. Still use the method in 2 to synchronize files regularly, which is the sync mentioned above.
This is my thinking.

曾经蜡笔没有小新

rsync server file synchronization

phpcn_u1582

You have deployed one of the servers in the term using git, and all other servers can be synchronized with the current machine using one-way rsync

Ty80

Use Capistrano

为情所困

Use teamcity or jenkins to automatically build tools, and then write scripts to upload the built files to each machine.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!