Deployments
A deployment puts a release of an app on an environment's servers, one after another, and checks its health on each before going on.
What's deployed
A program's release is packed as an archive, its Archive packager's: the program, its libraries and its runtime, such as its own JDK or Python, so the server needs nothing installed. A program needs no packager line for it. Archive: { platforms = [linux-x64, linux-aarch64] } packs it for more platforms, and a scripts/run.sh in the project replaces how it starts. A custom build's service can carry tools too, each archive with its platform's.
With packager = Docker, it's a Docker image instead: the same layout under /opt/<name>, on a base image a build dependency names, such as DebianSlim. The server runs it in Docker, under the same systemd service, so its steps, its health check, Restart and its journal are an archive's, its fourth step Load the image. Docker is root, so an image goes only to hosts whose group has System services on, with Docker installed. See Run your service as a Docker image.
Server by server
An environment runs one deployment at a time. Its servers go one after another, in order, and each one takes these steps:
- Connect to the server
- Check what it runs
- Upload the release
- Unpack it
- Write the service's unit
- Restart the service
- Check its health
- Keep the newest five releases
A server that fails stops the deployment, and those after it keep what they run. A server that isn't ready yet gets the release once it is, and one that joins later gets what the others run; while the environment is locked, once it's released.
When the environment has sidecars, each host's turn ends with a step for each sidecar whose copy there needs its picked release or new values, such as (9/9) LogShipper/Prod #31 → #33, and a step that takes off a sidecar it no longer has. A copy that fails is a warning, never the deployment's failure.
Health, and putting it back
A release that doesn't come up healthy is put back on its own, on that server, and the deployment stops. Deploy settings say how to tell:
| Setting | What it does |
|---|---|
health-url |
the address that must answer, such as http://localhost:8080/health; an image's as its container sees itself, asked at the container's address |
health-timeout |
how long to wait for it (default 60 s) |
systemd |
user (the default) or system |
stop-timeout |
how long it gets to stop; an image's hooks and program within it |
ports, volumes |
an image's: 8080:8080 publishes a port, /srv/data:/data mounts a folder |
Hooks
Scripts in the project's scripts/ run on the server around the restart, and an image's inside its container, by its entrypoint, with what the image has:
| Script | When | If it fails |
|---|---|---|
pre-start.sh |
before it starts | the deployment fails |
post-start.sh |
after it starts | the deployment fails |
pre-stop.sh |
before it stops | a warning |
post-stop.sh |
after it stops | a warning |
What the service gets
The environment's Configuration, as variables, and where it runs: PLINTO_REGION, PLINTO_ENV and PLINTO_STAGE, from its Instance, which pick the lines of its configuration files; PLINTO_APP, PLINTO_ENVIRONMENT and PLINTO_VERSION; and the host it runs on, PLINTO_HOST and PLINTO_ADDRESS, with the app's PLINTO_PORT and PLINTO_HEALTH_URL, which a load balancer of your own takes it out and puts it back with.
Rolling back
On an environment's list of deployments, Roll back to this deploys an earlier release again, as a new deployment:
Nothing else changes: it gets the environment's configuration as it is now, and the pipeline's next candidate deploys over it.
The deployment page
Each deployment has a page: its servers and each one's steps, and the log, live, per server or as the Whole log.