# Deployments

> One app running for several companies of a group, for a test copy, or for a client of yours: each deployment with its own address, data, users, settings and branding.

A deployment is one live copy of your app. Every app has one from its first deploy, under the app's own name. You can add more: the same app, the same versions, but each deployment with its own data.

## What each deployment has of its own

- its address, `<subdomain>.golocomotive.fr`;
- its data: its database, its files and its backups;
- its users, managed from the **Users** tab;
- its access setting: anyone with a login, or listed internet addresses only;
- its branding: a name, a color, a language and a logo, each one left blank to keep the app's own;
- its version and its history of versions, so it can move to a new version before or after the others.

Each deployment runs as its own process, under its own system user, on our production server in Amsterdam. Nothing in one deployment can read another.

## When to have several

- **A group with several companies** that each keep their own data, their own users and their own logo, on one app.
- **A test copy** that takes each new version first, before your main deployment.
- **Several sites** that must keep their data apart, one deployment per site.
- **A client of yours** who uses the same app with no change, under their own name and address.

Several sites that share their customers and their figures stay in one deployment instead: the Sites module gives each person the rows of their own sites, and the managers see them all (see [Modules](https://golocomotive.fr/docs/apps/modules.md#the-common-modules)).

## Add a deployment

1. Open the **Releases** tab. **Deployments** lists each one: its address, its version, its health and its access.
2. Click **New deployment**. Give it a name: lowercase letters, digits and single dashes, 27 characters at most, used by no other app or deployment. The portal shows the address it gets as you type.
3. Pick the version to put on it, the newest by default, and confirm. The steps show as they run, then the address of the new deployment.

## Work on one deployment

- **Pick it.** A click on a row of Deployments picks that deployment. The header's live version, the **Users** tab's Prod view and the **Prod** part of the settings then act on it.
- **Deploy a version to it.** Each version in the changelog has **Deploy to…**, a menu of the deployments with the version each one runs. A version can go to one deployment first and to the others after.
- **Revert** and **Undeploy** sit on each row, as for the main deployment. See [Release and deploy](https://golocomotive.fr/docs/using/releases.md).
- **Forget** removes a deployment that is not live from the list. The main deployment, under the app's name, stays.

## Branding

Set a deployment's name, color, language and logo in the gear's **Prod** part, with that deployment picked. A blank field keeps the app's own. The branding reaches the live deployment with **Apply**, which puts its live version back with the new look, in a few seconds.

## What stays shared

All deployments of an app run the same code. A change you ask for, a module you add and a version you release are the app's, and each deployment takes them when you deploy that version to it. A company that wants its own screens, beyond its branding, gets its own app.
