Skip to content

Compares expected environment variables to those set in production.

License

Notifications You must be signed in to change notification settings

nateprewitt/env-diff

 
 

Repository files navigation

Unix: Unix Build Status Windows: Windows Build Status
Metrics: Coverage Status Scrutinizer Code Quality
Usage: PyPI Version

Overview

diff-env is a command-line to tool to generate reports to compare the value of environment variables in each of your environments against the defaults defined in various files. It will help you you find:

  • variables absent from production, but will be required for a new feature in test
  • production values that shouldn't be shared to your staging environment
  • variables set that are no longer referenced in any files

This tool was built with Heroku, but should work with any infrastructure that supports running commands remotely.

Setup

Requirements

  • Python 3.6+

Installation

Install env-diff with pip:

$ pip install env-diff

or directly from the source code:

$ git clone https://github.com/jacebrowning/env-diff.git
$ cd env-diff
$ python setup.py install

Usage

Generate a sample config file:

$ env-diff --init

Customize this file to match your project:

  • sourcefiles: contain references to environment variables used in your project
    • path: relative path to source file
  • environments: the environments in which your project runs
    • name: name of the environment
    • command: command to display currently set environment variables

Generate reports to show the differences between each environment variable:

$ env-diff

Demo

Input YAML config file:

input

Running in a terminal:

run

Output (as viewed in TableTool):

output

About

Compares expected environment variables to those set in production.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 77.5%
  • Makefile 22.5%