A device that updates itself

hack-friday

#1

Project Jormundandr

From Norse, the serpent that went all around the earth eating it’s own tail. Nicely fits into the themes of sea beasts and looping

(sorry that the LCD doesn’t photograph properly, the screen has the current time, the most recent action and the most recent push. It currently looks as though the resin servers are healthy with an 8 minute journey from when the push starts until the fleet is updated)

All this device does is update itself, and display some information about that to the Displayotron Hat.

  • The dockerfile puts various metrics about the build into the log file
  • The device downloads the latest build
  • The code sets up a render loop, putting metrics and a red/green status on the displayotron
  • The do.sh clones its own repo, putting metrics into the log file
  • The do.sh puts the updated log file into the repo, commits and pushes
  • The merry go round revolves again

A couple of interesting points about this:

  • The clone has to be --depth capped or it grows and results in a false error.
  • The device needs to be given a key, I created a single use collaborator for this purpose.
  • The full log history is in the commit history, it being git backed.
  • This one little device is a rather crude test and benchmark of the ‘git push to your fleet’ origin story of Resin.