1

I have a bunch of raspberry pi's running a custom image which hosts a local server. I have no control of where these devices end up or whether or not they are connected to the outside internet.

I am currently using git for development of the project and I was wondering if git could be used to automatically deploy updates to the devices.

If every time they are connected to the internet they try a git pull they would theoretically download any new updates. I could easily write an update script that after a successful pull it checks for new software requirements and installs them.

There could potentially be hundreds of these devices all over the place and I was wondering if this is feasible or if anyone knows any issues with this method. Should this not be used with many devices? Are there any security issues with this?

martineau
  • 119,623
  • 25
  • 170
  • 301
jdm
  • 165
  • 1
  • 8

1 Answers1

1

There is no exactly a git pull hook, and, as noted here, Git itself is not exactly a deployment tool.

If you write an "update" script, it would be better to write a listener, which could be called automatically by a repository hosting service.
That is how a GitHub webhook works for instance.

Since you have hundreds of those, a single webhook would not be enough.
Instead, you would need to write a program (distributed on each device) which polls every few hours for new commits (git pull) and then call your update script.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250