KLXM Studio – Home
Get in touch

Agencies & network · Advanced · 0:41 min

Staging & deploy

What the interface shows – and the commands for releases, rollback and content.

No sound, with subtitles German and English captionsText of what is spoken in a video, shown in sync. On the web usually a WebVTT file; captions help deaf people and anyone watching without sound.developer.mozilla.org (opens in a new tab) – switch them on and off with “CC” in the player. The video is hosted on this server and only loads when you press play. The steps below are the full text of the video.

Goal

Code reaches the server tested and with a backup; stagingTest environment that mirrors the live website. New features and content can be checked there before they go online – search engines stay locked out.en.wikipedia.org (opens in a new tab) gets a copy of the live content when needed.

Prerequisites

  • SSH access or CI (GitHub Actions) and target files deploy/targets/{target}.env.

Step by step

Transcript: every step matches one subtitle in the video.

  1. Staging is a separate installation with a copy of the live content. The network shows what is not live.
  2. Before interventions: “⋯” – maintenance mode, test environment (staging), backup now, clear page cache.
  3. Health check for deployTransferring a new software version to the server so that it runs there. In KLXM Studio this concerns the code – the content of the live website stays untouched.en.wikipedia.org (opens in a new tab): /health answers without secrets (ok, version, environment).
  4. Deploy on the command line: deploy/deploy.sh staging or production – with backup, migrate, health and rollback.

Commands & configuration

deploy/deploy.sh staging                 # bauen, hochladen, migrieren, prüfen, umschalten
deploy/deploy.sh production              # zusätzlich vorher Sicherung
deploy/deploy.sh production --rollback   # vorheriges Release aktivieren
deploy/sync-content.sh default           # Datenbank + Medien einer Website: Live → Staging

php bin/console health --all
php bin/console site:backup --all

Tips & pitfalls

Tip

Staging ('environment' => 'staging') keeps search engines out, shows a notice bar and redirects emails.

Watch out

Schema changes run against the live database before switching – they must be additive.