Manage environment variables between development and production
A configuration scheme keeps names, types, and required values consistent, while secret or environment-specific values are provided separately.
For developers and technical project managers, "Versioned Schema" and "Separate Values" are crucial when it comes to "Consistently Managing Environment Variables." The "Mandatory Version Source" perspective shows how these two aspects work together in practice.
Published: 3 min read · Author: Sebastian Geier
How can environment variables remain manageable between development, staging, and production?
The repository contains a secure example and a mandatory configuration schema. Application and deployment check mandatory values early; sensitive content remains in appropriate storage and is assigned separately for each environment.
Versioned Schema
Test criterion
Versioned Schema
Name, type, mandatory status, and permissible value range are maintained with the code.
Test criterion
Separated Values
Development, staging, and production have their own permissions and no copied secrets.
Early Failure Missing or invalid required values stop startup or deployment with a clear diagnosis.
Silent Default
Silent Default A hidden default causes production to start with a development assumption.
Secret Copy Production credentials end up in local sample files or staging.
Name Drift Code expects a new variable name that not all environments have.
Limitation Case: "Silent Default"
A new API URL is added to the schema with its type and mandatory status. Staging and production environments receive separate values from their respective storage locations; if the production entry is missing, the application terminates with a unique message instead of reverting to localhost.
Early Failure
Deployments that stop due to missing or invalid configuration.
Configuration values without a documented owner or defined storage location.
Separated Values
All read values are recorded with their type, sensitivity, owner, and environment.
Schemas and safe examples are moved to the repository, real secrets to controlled storage.
Startup tests check for missing, incorrect, and outdated values in each target environment.
What "Managing Environment Variables Consistently" Means for Related Tasks
A suitable in-depth resource is available Using Git as the authoritative source instead of an additional copy"What rules make Git the only reliable source for application code?"
In addition: Store configuration outside the publicly accessible web root..
If you want to implement "Managing Environment Variables Consistently" in practice, you can refer to Robust Website Systems This focuses on "Mandatory Version Source" and "Versioned Schema."
Conclusion: Managing Environment Variables Consistently
Configuration schema and real-world values have different lifecycles. Their clear separation prevents leaks and environment-dependent surprises.
Sources and Further Information
These primary sources make assumptions, system boundaries, and testing methods for "Managing Environment Variables Consistently" transparent.
Secure Software Development Framework Version 1.1 – NIST SP 800-218The NIST framework requires integrity, provenance, and controlled changes of software components throughout their lifecycle.
Git workflows – Git DocumentationThe official Git documentation describes small independent changes, integration branches, and reasoned workflow decisions.
Key Thesis
The repository contains only the schema, safe examples, and validation logic. Each environment retrieves its values from a controlled configuration or secret store and will fail early if required values are missing.
What This Is Not About
Environment values should not be stored entirely in the repository or in unstructured local files without a schema.
What it's about
Code versiones names, types, and validation; each environment retrieves real values in a controlled manner from configuration or secret stores.
More insights
Git, deployment, and quality assurance
Keep secrets out of repositories and systematically clean up leaks.
"Managing environment variables consistently" includes, as a separate check, the question: What needs to be done, and in what order, after an accidentally checked-in secret?
Git, deployment, and quality assurance
Secure database changes together with code changes.
Adds a separate decision to "Consistently manage environment variables": How can database migrations be rolled out without risky coupling to a code change?
Insights Overview
All VELUNO Insights at a Glance
Further analyses on Website Systems, digital visibility, and robust working models.
Versioned schema: Implementation with clear validation
A comparison between read variables and provided values creates transparency. Missing types, defaults, and owners can then be specifically addressed.