git push deploy#
I am trying to find the simplest way to deploy stuff on a remote with pyinfra and ssh while keeping a history of config changes in a separate git repo.
Each deployment lives in a git repo, e.g. root@enterprise:/opt/zitadel.
The deployment owns its config (mise), secrets (fnox) and setup (docker compose).
To edit a deployment on locutus, I simply do
cd ~/deploy/zitadel
git push
For that to work, the repo has to fulfil a contract:
there MUST BE an
upscript in the repo rootthere MAY BE a
pre-flightscript in the repo root
That’s almost it.
For git push to execute those scripts [^hooks], the repo must be configured on the remote. That is where pyinfra comes in. It does the following steps:
init the repo
/opt/zitadelonenterpriseasrootregister generic scripts as git hook that run
the
pre-flightscript in git’spre-receivehook (optionally)the
upscript in thepost-receive
TODO: some code examples here. If you are interested, hit me up on The Matrix.