Envers adalah alat baris perintah (CLI) yang dirancang untuk mengelola dan versi variabel lingkungan untuk berbagai tahapan penyebaran seperti pementasan, pengembangan, dan produksi. Ini memberikan cara yang aman dan terorganisir untuk menangani konfigurasi khusus lingkungan.
Tbd
Di bawah ini adalah sub -perintah awal untuk envers :
envers init : Inisialisasi lingkungan envers .envers deploy <spec version number> : Menyebarkan versi spesifik dari file spesifikasi.envers draft <spec version number> : Buat draf versi baru di file spesifikasi. Beberapa varian dari perintah ini: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> : Tambahkan konten baru.envers profile load --profile prod --spec <spec version> : Muat profil lingkungan tertentu ke file envers init membuat file spesifikasi di .envers/.specs.yaml .
envers deploy membuat file .envers/.data.lock . File ini dihasilkan secara otomatis oleh perintah envers , dan dienkripsi.
Versi awal ./.envers/.specs.yaml akan terlihat seperti ini:
version : 0.1 # the envers spec version
releases :Seperti yang Anda lihat, itu tidak memiliki terlalu banyak informasi. Jika Anda ingin menyusun versi baru, Anda dapat menjalankan perintah berikut:
$ envers draft 1.0 Setelah perintah ini, file .envers/specs.yaml akan terlihat seperti ini:
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 definedSekarang, Anda dapat menggunakan variabel lingkungan versi pertama Anda:
$ envers deploy 1.0 Ketika suatu versi digunakan, ia menciptakan secara otomatis semua spesifikasi baru ke dalam .envers/data.lock .
Semua variabel untuk setiap profil dan versi spesifikasi disimpan menjadi .envers/data.lock , dan file ini tidak boleh diubah karena alasan apa pun.
Akhirnya, kita dapat membuat variabel lingkungan untuk profil base :
$ envers profile set --profile base --spec 1.0 envers akan meminta Anda melalui prompt nilai untuk setiap variabel yang ditentukan dalam spec untuk versi 1.0 .
https://osl-cubator.github.io/envers
BSD-Clause 3