Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto update hundred of Windows deployments upon a push to Git master branch

I'm trying to use Git to manage a product installed on many Windows servers. Here is the current status:

  • Every client has pulled the repository and is on the master branch,
  • Servers are always on and connected to the Internet,
  • I have full access (the administrator) to the servers but some other guys (out of my company) has access too, so I should be careful with credentials such as SSH keys,
  • Product source code is small (not more than 5MB).

And the following is what I'm trying to achieve when I (as developer) push commits to master branch on the Git server:

  • All the Windows servers automatically pull new commits and update their copy to the latest version,
  • Execute some scripts (to restart some services, run tests, etc.),
  • Log the entire updating process,
  • The server report it's current status (Git commit, tag, and branch) to a remote server so I can check the status of all servers after each push.

What are my options? Is there any software or I have to build my own? I checked Git hooks but it seems they trigger after I manually pull code on each server.

like image 925
mrdaliri Avatar asked Apr 13 '18 04:04

mrdaliri


1 Answers

Heres an idea,

  1. Designate one of the servers as a Jenkins server
  2. Set up the rest of the servers as Slaves/ Agents

Heres the working process

  1. You commit an executable file (.sh .bat .exe)
  2. Jenkins notices the commit and runs the file on all the machines
  3. The Agent executes the commands while logging the terminal in Jenkins
  4. Jenkins tells you if your build succeeded or failed

If you would like to try this strategy I would be glad to help

Plus Jenkins is a web app so you can access it from many devices!

like image 143
JosephWorks Avatar answered Oct 03 '22 03:10

JosephWorks