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.
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
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
Use Capistrano
Use teamcity or jenkins to automatically build tools, and then write scripts to upload the built files to each machine.