Environment Management

Document: 25-environment-management.md
Version: 1.0.0


Purpose

This document defines the environment management strategy used across all Rundown projects.

Environments provide isolated spaces for development, testing, staging, and production. A consistent environment strategy reduces deployment risk, simplifies debugging, and ensures that applications behave predictably throughout their lifecycle.


Environment Philosophy

Applications should behave consistently across every environment.

Code should remain the same.

Only configuration should change.

Environment-specific behaviour should be controlled through configuration rather than conditional application logic.


Standard Environments

Every Rundown project should support the following environments:

Development

↓

Staging

↓

Production

Additional environments may be introduced for enterprise projects when justified.


Development

Purpose:

Daily development.

Characteristics:

Development should prioritize developer productivity.


Staging

Purpose:

Final validation before production deployment.

Characteristics:

Staging should be as close to production as possible.


Production

Purpose:

Serve real users.

Characteristics:

Production should remain stable and predictable.


Responsibilities

Environment management owns:


Non-Responsibilities

Environment management should not own:

Applications should never behave differently because of business logic tied to an environment.


Configuration

Configuration should be stored outside the application source code.

Typical examples include:

Configuration should never be hardcoded.


Environment Variables

Every project should provide:

.env.example

This file should document all required variables without exposing sensitive values.

Sensitive credentials must never be committed to version control.


Feature Flags

Feature flags may be used when introducing incomplete or experimental functionality.

Feature flags should:

Avoid long-lived feature flags that increase application complexity.


Database Strategy

Each environment should have its own database.

Development data must never be shared with production.

Production databases should never be modified for testing purposes.


Media Strategy

Each environment should have isolated media storage.

Development uploads should not appear in production.

Production assets should remain protected from accidental modification.


Secrets Management

Secrets should:

Access to production secrets should be restricted to authorized personnel.


Promotion Strategy

Code should move through environments in sequence:

Development

↓

Staging

↓

Production

Skipping environments should only occur in exceptional circumstances.


Environment Parity

Development and staging should closely resemble production.

Differences should be limited to:

Maintaining parity reduces deployment surprises.


Engineering Decision

Configuration Over Code

Status: Accepted

Decision

Environment-specific behaviour is managed through configuration rather than application logic.

Reasoning

This approach:


Environment Checklist

Before deploying a new environment, verify:


Summary

Environment management provides predictable and isolated execution environments throughout the application lifecycle.

By separating configuration from application code and maintaining strong parity between environments, Rundown projects reduce deployment risk while improving reliability and maintainability.