Skip to main content

Compares expected environment variables to those set in production.

Project description

Unix: Unix Build Status Windows: Windows Build StatusMetrics: Coverage Status Scrutinizer Code QualityUsage: 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

Revision History

0.4 (2017-04-03)

  • Added extra context around variable use in Heroku app.json files.

0.3 (2017-03-30)

  • Added CSV report generation.

0.2 (2017-03-30)

  • Added detection of source variables matching export FOO=bar.

  • Added Markdown report generation.

0.1 (2017-03-30)

  • Initial alpha release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

env-diff-0.4.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

env_diff-0.4-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file env-diff-0.4.tar.gz.

File metadata

  • Download URL: env-diff-0.4.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for env-diff-0.4.tar.gz
Algorithm Hash digest
SHA256 cdc6fea2a2446a966a283dcf30e29a9598ed41873e8445385d024176915ae2eb
MD5 a78037896ce4be6a1b55fb8cca610dd3
BLAKE2b-256 ec8ca858747ca035eee85f64db61a78aba4cd5c77a7e5c1ff53106dd5e2488bf

See more details on using hashes here.

File details

Details for the file env_diff-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for env_diff-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 33bb8e8df5ebd113835b4e9d951ee7eb75ae797a5b9caa3d75239337e440343c
MD5 97ffdf69d9702d4c9fecd2e6982751f8
BLAKE2b-256 4397e1006d952117b848db246da2268034ae82313045c356faa427f785f9a7f9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page