envers
0.4.1
Envers 、ステージング、開発、生産などのさまざまな展開段階の環境変数を管理およびバージョンするように設計されたコマンドラインツール(CLI)です。環境固有の構成を処理するための安全で整理された方法を提供します。
TBD
以下は、 envers向けの初期サブコマンドです。
envers init : envers環境を初期化します。envers deploy <spec version number> :仕様ファイルから特定のバージョンを展開します。envers draft <spec version number> :SPECファイルに新しいバージョンドラフトを作成します。このコマンドのいくつかのバリアント:envers draft <spec version number> --from <previous spec version number>envers draft <spec version number> --from-env .envenvers profile-set --profile <profile_name> --spec <version_number> :新しいコンテンツを追加します。envers profile load --profile prod --spec <spec version> :特定の環境プロファイルをファイルにロードするenvers init .envers/.specs.yamlで仕様ファイルを作成します。
envers deploy 、ファイルを作成します.envers/.data.lock 。このファイルは、 enversコマンドによって自動生成され、暗号化されています。
./.envers/.specs.yamlの初期バージョンは次のようになります。
version : 0.1 # the envers spec version
releases :ご覧のとおり、あまり多くの情報がありません。新しいバージョンをドラフトする場合は、次のコマンドを実行できます。
$ envers draft 1.0このコマンドの後、 .envers/specs.yamlファイルは次のようになります。
version : 0.1 # the spec version
releases :
# placeholder: the version for the environment variables.
# if the status is draft, feel free to change the version number
1.0 :
# status attribute is handled by command line, don't change it manually
status : draft # options are: draft, cancelled, deployed
# placeholder: update help with the real help text
help :
# placeholder: a list of available profiles (groups) for this version.
# at least one profile is required for the deploying
profiles :
- base
# define the spec for that version, this spec should be used for all
# profiles (groups) inside this version
spec :
# define the env file or any other kind of environment file to be used,
# for now it just has support for .env files
files :
# placeholder: change `.env` to the correct dotenv file relative path
.env :
type : dotenv # default
# `vars` is a dictionary for the environment variables
# this defines the variables and some metadata, but not the real
# value, because it is just the definition of the spec.
vars :
# placeholder: ENV is just a variable name, replace it by your real
# environment variable
ENV :
type : string # options are: string, int, bool, path
default : dev # in the case that the variable is not definedこれで、環境変数の最初のバージョンを展開できます。
$ envers deploy 1.0バージョンが展開されると、 .envers/data.lockにすべての新しい仕様を自動的に作成します。
各プロファイルと仕様バージョンのすべての変数は.envers/data.lockに保存されます。このファイルは、何らかの理由で変更されるべきではありません。
最後に、 baseプロファイルの環境変数を作成できます。
$ envers profile set --profile base --spec 1.0 envers 、バージョン1.0の仕様で定義されている各変数の値をプロンプトで尋ねます。
https://osl-incubator.github.io/envers
BSD-Clause 3