Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacebrowning/env-diff
Compares expected environment variables to those set in production.
https://github.com/jacebrowning/env-diff
command-line deployment devops environment-variables heroku sysadmin
Last synced: 29 days ago
JSON representation
Compares expected environment variables to those set in production.
- Host: GitHub
- URL: https://github.com/jacebrowning/env-diff
- Owner: jacebrowning
- License: gpl-3.0
- Created: 2017-03-27T14:26:37.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2020-09-07T15:04:55.000Z (about 4 years ago)
- Last Synced: 2024-10-13T20:16:08.111Z (about 1 month ago)
- Topics: command-line, deployment, devops, environment-variables, heroku, sysadmin
- Language: Python
- Homepage: http://env-diff.readthedocs.io
- Size: 574 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
Unix: [![Unix Build Status](https://img.shields.io/travis/jacebrowning/env-diff/develop.svg)](https://travis-ci.org/jacebrowning/env-diff) Windows: [![Windows Build Status](https://img.shields.io/appveyor/ci/jacebrowning/env-diff/develop.svg)](https://ci.appveyor.com/project/jacebrowning/env-diff)
Metrics: [![Coverage Status](https://img.shields.io/coveralls/jacebrowning/env-diff/develop.svg)](https://coveralls.io/r/jacebrowning/env-diff) [![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/jacebrowning/env-diff.svg)](https://scrutinizer-ci.com/g/jacebrowning/env-diff/?branch=python3-pytest)
Usage: [![PyPI Version](https://img.shields.io/pypi/v/env-diff.svg)](https://pypi.python.org/pypi/env-diff)# Overview
`env-diff` 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 filesThis tool was built with [Heroku](https://www.heroku.com/continuous-delivery) in mind, but should work with any infrastructure that supports running commands remotely.
# Setup
## Requirements
* Python 3.6+
## Installation
Install `env-diff` with pip:
```sh
$ pip install env-diff
```or directly from the source code:
```sh
$ git clone https://github.com/jacebrowning/env-diff.git
$ cd env-diff
$ python setup.py install
```# Usage
Generate a sample config file:
```sh
$ 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 variablesGenerate reports to show the differences between each environment variable:
```sh
$ env-diff
```# Demo
Input YAML config file:
![input](https://raw.githubusercontent.com/jacebrowning/env-diff/develop/docs/demo/input.png)
Running in a terminal:
![run](https://raw.githubusercontent.com/jacebrowning/env-diff/develop/docs/demo/run.png)
Output (as viewed in [TableTool](https://github.com/jakob/TableTool)):
![output](https://raw.githubusercontent.com/jacebrowning/env-diff/develop/docs/demo/output.png)