LXC CI/CD Configuration¶
The LXC CI/CD reacts to your git provider's webhooks: a push on a feature branch creates, deploys or destroys Test Servers, according to what the Application Definition declares. The same settings pre-fill the deployments you launch by hand on Staging and Production Servers. What each push does is in How LXC CI/CD Works.
Activating it¶
In the Application Definition, check Activate LXC CI/CD. A CICD LXC tab then appears.
Note
The repository's Git Project ID and Git Project Name must be set before the option can be activated: they let Muppy match an incoming webhook to this Application Definition. See Connect your git provider.
The CICD LXC tab¶
One field applies to the whole definition:
- Upgrade Task — the Muppy Task that runs the database init and upgrade commands. The
task shipped with Muppy runs the command, keeps its log, and marks the upgrade failed on a
non-zero exit code or an Odoo
ERRORorCRITICALline.
Everything else is grouped in sub-tabs, one per kind of server: Test Servers,
Staging Servers, Production Servers. The field labels carry the kind in parentheses
(… (Test), … (Staging)).
- Test Servers holds what a push on a feature branch does: provisioning, deployment, deprovisioning.
- Staging Servers and Production Servers hold the defaults of the deployments you launch by hand. Their Activate Auto deploy (Staging) and Activate Auto deploy (Prod) are off and read-only: a push on their branch deploys nothing. See Deploying Staging and Production.
Deployment parameters¶
| Field | Meaning |
|---|---|
| re-Deployment Trigger | Every push — deploy on every push. Comment tag — deploy only when a commit message of the push carries a given tag. |
| Deploy Trigger comment tag | The tag that triggers a deployment in Comment tag mode, e.g. #mpy_deploy_test. |
| Stop Primary Before Deploy | Stop the server before deploying. On by default. |
| Reset Repository | Erase and re-clone the repository at every deployment, instead of updating it (git fetch then git checkout). Off by default. |
| Launch builder | Run the builder at every deployment. On by default. It always runs after a re-clone. |
| Git Access Token | The git credential used to fetch the code. |
Provisioning parameters (Test servers)¶
| Field | Meaning |
|---|---|
| Activate Auto deploy (Test) | Master switch for automatic deployment on feature branches. On by default. |
| Branch exclusion Regex | A push on a branch matching this regex is ignored. |
| Provision Server on commit (Test) | Create the server if it does not exist yet. Off by default. |
| Deprovision on branch Delete | Destroy the server when its branch is deleted. On by default. |
Staging servers have Default Staging branch instead: the branch whose pushes reach them,
staging by default.
Database initialisation parameters¶
They apply when Muppy creates a server.
| Field | Meaning |
|---|---|
| Database source Strategy | Empty Database — create an empty database, then run the 'init' command if one is set. Seed Database (as pg_dump) — restore a sample dump, given in the field below. Most recent Dump of a Database — restore the latest backup of an existing database. Left empty, no database is created. |
| Seed pg_dump | The dump used as seed, in Seed Database mode. It is a backup Muppy knows (Muppy › Databases › PostgreSQL › Database Backups (pg_dump)), in a format pg_restore reads. A plain SQL file does not qualify. |
| Backed-up Database | The database whose latest backup is used, in Most recent Dump mode. |
| Default 'init' command | The shell command that initialises the database. Required with a seed or a dump: it runs on the restored database. Redirect to $UPGRADE_LOG_FILE to capture large logs (e.g. … > $UPGRADE_LOG_FILE). |
Database upgrade parameters¶
| Field | Meaning |
|---|---|
| Default 'upgrade' command | The shell command that upgrades the database. Pass the arguments as the shell will receive them, on a single line. Empty or none, the deployment upgrades nothing. |
| Backup Before Upgrade | Back the database up before the upgrade command runs. A deployment that upgrades nothing takes no backup. On by default. |
| Duplicate DB Before Upgrade | Duplicate the database instead of dumping it (into {{db_name}}_bu). Use this on databases so large that a backup takes too long. It applies to deployments launched by hand; a deployment started by a push never duplicates. Off by default. |
| Stop Before Backup | Stop the server before the backup or the duplication. On by default. |
| Delete Dupl. DB after upgrade | On a successful upgrade, drop the duplicated database. On by default. |
Others¶
Host Allocator (Test) decides where a new Test Server is placed — it defaults to the allocator set in Muppy Settings — and the Qualifier field of each sub-tab is the qualifier stamped on the servers of that kind.
Application downtime during a deployment¶
A deployment stops the application — the systemd units mpy_*_appsrv_* of the App Server —
for as long as the options above ask. Each deployment records how long, so you can weigh
those options against what they cost.
What each option keeps down¶
| Options | The application stops | It is back | What runs while it is down |
|---|---|---|---|
| Stop Primary Before Deploy on (the default) | at the start, before the checkout | at the final restart | checkout, builder, backup, upgrade, restart |
| Stop Primary Before Deploy off, Stop Before Backup on, an upgrade command | before the backup or the duplication of the first database upgraded | at the final restart | backup or duplication, upgrade, restart |
| Neither | not before the end: the upgrade runs with the application up | at the final restart | the restart alone |
| A standby of an HA pack, Stop Standbys Before Deploy on | before its checkout | when its units start again, unless the standby is kept stopped (HA standby mode) | checkout, builder, start |
| A standby of an HA pack, Stop Standbys Before Deploy off | not before the end: checkout and builder run with the standby up | at its restart, which loads the new code | the restart alone |
Stop Before Backup stops the application whenever an upgrade runs, whether or not a backup or a duplication is asked.
Where to read it¶
- On the App Server, in the deployment history (Upgrades page, Deployments list; the Deployments page in Manganese): the Downtime column, in seconds. Open a deployment to see the Application downtime group: App stopped at, App stopped by (the option that stopped it, or Restart only when no option did and the final restart is the whole downtime), App back at and App downtime (s). Left down by names the failed deployment whose stop time it took over (see below).
- In the IMQ message of the deployment, once it is done: its Result holds one entry per
server deployed.
{"app_downtime": [
{"dev_server": "my-app-main-dev", "dev_server_id": 117, "role": "standalone",
"deployment": "upg1133", "stopped_by": "stop_primary_before_deploy",
"stopped_at": "2026-10-15T13:38:12Z", "restarted_at": "2026-10-15T13:42:40Z",
"downtime_s": 268, "downtime": "0:04:28", "left_down_by": null}
]}
Times are UTC. role is standalone, primary or standby. A server nothing stopped has
null in stopped_by, stopped_at, restarted_at, downtime_s and downtime; a standby
kept stopped has null in the last three. left_down_by names the failed deployment whose
stop time was taken over, or is null.
- In the message's log, one line per server, after its restart:
App 'my-app-main-dev' down for 0:04:28 (stopped at 13:38:12 UTC by stop_primary_before_deploy, back at 13:42:40 UTC).
The duration runs from the first stop Muppy sends to the return of the last restart. It is an upper bound of a few seconds, since each command is followed by a read of the units' state, and it says nothing of when the application answers HTTP requests again.
When a failed deployment left the application stopped, and every unit is still stopped when the next one
starts, the next one takes over that stop time: its duration counts the whole outage, its
Left down by names the failed deployment, and its log line says
… (stopped at 07:54:20 UTC by stop_primary_before_deploy, left down by upg1129, back at 13:42:40 UTC).
If you started a unit in between, nothing is taken over, and the log says which unit was running.
A database upgrade that ends with errors marks the deployment Upgrade Failed. The application is restarted all the same, and its downtime is measured. A restart that Muppy cannot confirm, because the host did not answer, marks the deployment Upgrade Failed too, and leaves App back at empty.
A deployment that fails after the stop leaves the application down
Muppy does not restart the application when a deployment fails after stopping it: a failed
git fetch, a build error, an upgrade that raises. The deployment stays In Progress, with
App stopped at set and App back at empty, and it turns Upgrade Failed when the next
deployment of the server starts. The application stays down until a deployment succeeds, or
until you start its units yourself (Start All, on the Systemd Units of the App Server).
