envers
0.4.1
Envers是一種命令行工具(CLI),旨在管理和版本的環境變量,用於不同部署階段,例如分期,開發和生產。它提供了一種安全且有條理的方法來處理特定環境配置。
TBD
以下是envers的最初子命令:
envers init :初始化envers環境。envers deploy <spec version number> :從規格文件中部署特定版本。envers draft <spec version number> :在規格文件中創建新版本草稿。此命令的一些變體: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