Skip to content

Update process

Julian Christl edited this page Mar 31, 2021 · 6 revisions

Initial conditions:

  • Raspberry Pi with current docker image A (DI_A),
  • The new update as docker image B (DI_B).
  • Theoretical instances on the Raspberry Pi 1 and 2 (DC_1, DC_2).
  • The Nginx with the hostname equal to the container name of DC_1 and therefore DC_1 used for the active service
  • DC_1 running with DI_A

Github pipeline:

  1. Github: Change on trunk
  2. Github: Build and Test
  3. Github: Execute docker build
  4. Github: Push docker image to the image registry
  5. Github: Call all deployment projects in parallel

For each deployment project:

  1. Github: Connect to the Raspberry Pi via SSH
  2. RBP: Download DI_B, read current hostname from Nginx config
  3. RBP: Start DC_2 with current hostname as an argument and DI_B and remember container name
  4. DC_2: Call DC_1 using the delivered hostname and sync the current state
  5. RBP: Wait for full startup of DC_2, save DC_2 docker container name as the new hostname in the Nginx config
  6. RBP: Reload Nginx
  7. RBP: Remove DC_1 container

The next time this gets repeated with DC_1 and DC_2 switched.

Clone this wiki locally