Environment Variable Formatter | Free DevOps Tool | FOSSA

Environment Variable Formatter

Convert environment variables between different formats for your deployment environments.

About Environment Variables

Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. They are used to configure applications and are widely used in DevOps workflows for managing different environments, configurations, and secrets.

Common Formats

.env Files

The most common format for environment variables. Each line contains a key-value pair separated by an equals sign. Comments start with #.

# Database settings

DB_HOST=localhost
DB_PORT=5432

Docker Compose

In Docker Compose files, environment variables are specified under the "environment" section for each service.

version: '3'
services:
  app:
    environment:
      - DB\_HOST=localhost
      - DB\_PORT=5432

Kubernetes Secrets

In Kubernetes, sensitive information is stored as Secrets. Values are Base64 encoded.

apiVersion: v1
kind: Secret
metadata:
  name: database-credentials
type: Opaque
data:
  DB\_HOST: bG9jYWxob3N0
  DB\_PORT: NTQzMg==

Shell Export Commands

Shell scripts often set environment variables using the export command.

#!/bin/bash
export DB\_HOST="localhost"
export DB\_PORT="5432"
export API\_KEY="secret-key"

Best Practices