Orkestia
Blog
Cockpit app

App environments

Staging and pull-request preview environments in Apps mode — see them under their app, turn one on, promote the release it runs, and turn it off

Hosted apps can have staging and preview environments: copies where you try a release before production. What they are and what they cost is in Environments. This page is about working with them in Apps mode.

Reading is open to the organization. Turning on, promoting and turning off need an owner or admin; other roles see those buttons disabled with the reason.

Where they appear

An environment is an app of its own (its own sign-in app and database), but Cockpit keeps it under the app it belongs to:

PlaceShows
SidebarRows under the app: Staging and Preview · PR #12, each with a dot for its state
All appsA line on the app's card: Staging · 2 previews
Counts and the red badgeEnvironments are not counted as apps

Open an environment to see its own Health, Infrastructure, People & data and the rest, like any app. A banner at the top says Staging of (or Preview · PR #12 of ), its state, a link back to the app, and Promote and Turn off.

The Environments view

Apps → an app → Run → Environments, for a hosted app that is not itself an environment. One card per environment, staging first and then previews by pull request number:

On the cardMeaning
StateRunning, Asleep or Being removed. An asleep environment is not broken: it sleeps when nobody uses it (a preview after about 2 hours, staging after about 6) and wakes when someone opens it
AddressOpens in the browser
Serving a release / Nothing published yetWhether there is something to promote
Used …When it was last used
Expires in … / ExpiredPreviews only. An expired preview is listed, never removed for you

Each card has Open, Promote to and Turn off. The top of the view has Turn on staging and Turn on a preview…. An app has at most one staging and, by default, five previews.

Turn on

Every change shows the same sheet as the rest of Apps mode: what will happen, what won't, whether it can be undone.

  • Turn on staging: creates the staging copy with its own sign-in app and database, a daily backup kept 7 days, and its address <app>.staging.app.orkestia.dev.
  • Turn on a preview… asks for the pull request number (42 or #42). It creates pr-<n>-<app>.preview.app.orkestia.dev with its own sign-in app and a database with no backups.

It is several steps, so it can take a few minutes. When it is done the card shows the address.

Promote

Promote copies the release running on the environment, byte for byte and without rebuilding, one level up and publishes it there:

FromIntoYou type
StagingProductionThe app's name
A previewStagingNothing

A preview is promoted into staging, which must exist; the button says to turn staging on first. It is disabled when nothing is published on the environment yet. To go back, use the app's earlier releases under How it's built.

Turn off

Turn off asks for the environment's name. It retires the environment's database, keeping a final dump, and removes its sign-in app, site, address and logins. It cannot be undone from Cockpit: turning on again makes a new, empty environment. Afterwards you are taken to the app it belonged to.