Multiple server clusters, how to use git to automatically deploy code
淡淡烟草味
淡淡烟草味 2017-05-02 09:29:33
0
6
1650

We use git to host the code and have multiple servers online. We are looking for a way to automatically deploy the code and synchronize all servers;

Hope to provide more detailed plan information, thank you!

淡淡烟草味
淡淡烟草味

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