Open plinto
Docs›Concepts

Environments

Concept·3 min read
In one sentence

An environment is a place an app runs: a tree under the app, such as MyService/Prod/eu, where each one has its servers, its configuration and how it deploys.

Its rootthe app, named after its package
Its levelsup to six, named as you like
Inheritsits parent's configuration and settings

The tree

MyService
├── Beta
└── Prod
    ├── eu
    └── us

The levels mean what you make them mean. Each environment takes its parent's configuration and settings, and can change or unset any of them; only its servers and its sidecars are its own.

What an environment holds

Card What it holds
Configuration variables the service gets. A Secret's value is never shown again
Instance its region, environment and stage: what picks the lines of the app's configuration files
Deploy settings how a deployment checks health and stops the service
Targets the [[host
Sidecars the sidecars it runs beside it, a copy on each of its hosts

Two ways to configure

What runs where

An environment's page lists its deployments, newest first, with the release each one put there. Deploy puts a release of the group's main package there by hand, as a new deployment.

Locking it

To have an environment to yourself for a while, say to try a fix on Beta before it reaches main, open it and press Lock…, saying why. Everyone sees who holds it, since when and why: on its page, in the environments list, and in the pipelines that wait for it. Until someone releases it:

A lock is something whatever deploys checks first, never a wall: what was already queued or running when it was taken goes on, and a script that deploys checks it too, with an API token:

$ curl -H "X-Plinto-Key: $PLINTO_TOKEN" https://environments.plinto.build/environments-api/acme/environments/MyService/Beta/-/lock

It answers the lock, or 204 when there is none. A deployment someone else makes meanwhile is marked during ana's lock.

Anyone can press Release…. It can put back what ran before the lock was taken, ahead of anything else; otherwise the pipeline's next candidate replaces what runs. Try a fix on an environment walks through it.

Taking it off its hosts

What plinto put on a host comes off again when the host no longer runs the environment:

Taking off stops the service, with its stop hooks, removes its systemd unit and deletes its folder. A server listed by hand is taken off when its environment is deleted; one taken out of the list keeps what it ran.