From repository to running site – Plone deployment

From repository to running site#

Note

This chapter is part of the reference documentation of the training-deployment-gitlabdeploy repository, and is maintained there.

The other half of the picture. The training-deployment-playcluster repository builds the cluster; these chapters follow a Plone project from a git push to a running site on it.

They are written to be read: the aim is that afterwards you can read this pipeline, change it, and work out why it broke. Chapter 6 covers what it takes to deploy a copy of the project yourself.

The example#

training-deployment-gitlabdeploy, generated with cookieplone and then adapted for this cluster. Everything shown is in that repository, and every path mentioned is real.

What you should already know#

From the cluster documentation: the cluster runs Docker Swarm with a single shared Traefik on play1, application services attach to nw-public and announce themselves with labels, and play4 runs the CI runner and the registry outside the swarm.

Those facts constrain nearly every decision here.

Chapters#

The shape of it, in one picture#

  git push
     |
     v
  +---------------------------- play4 ----------------------------+
  |  GitLab Runner                                                        |
  |                                                                       |
  |  config --> check --> test --> build --------> deploy                 |
  |    |                            |                |                    |
  |    | reads repository.toml      | buildx         | over SSH           |
  |    | publishes settings         v                |                    |
  |    |                        zot registry         |                    |
  |    +----------------------------+----------------+                    |
  +-------------------------------  |  ---------------------------------+-+
                                    |                                   |
                                    | pull                       docker stack deploy
                                    v                                   v
  +------------------------ the swarm: play1/2/3 ---------------+
  |  Traefik --> frontend (x2) --> backend (x2) --> postgres (pinned)     |
  +-----------------------------------------------------------------------+

Five stages, one registry, one SSH connection. Everything else is detail.