@thematrixsg/demeter
v1.4.0
Published
Secrets provisioning script
Downloads
366
Readme
Demeter
Provision environment variable files using template
Build and Publish NPM package
- Make changes on index.js
- Bump version (on package.json file)
npm publish
Build and Publish Docker image
Q: I want to push new update for demeter (templating logic)
A: Do this!
# modify exisiting "tailscale-vault-nodejs-demeter" (base) image
# by replacing the "demeter file" then create new image out of it
npm run build-image
# publish new "tailscale-vault-nodejs-demeter-light"
npm run publish-image
Or
Q: I want to update the base image (versions) of tailscale/vault/nodejs
A: Do this!
# re-build the base image, based on Dockerfile.base
npm run build && docker build . -f "Dockerfile.base" -t thematrixsg/tailscale-vault-nodejs-demeter
# push new base image
docker push thematrixsg/tailscale-vault-nodejs-demeter
Usage
Before run make sure:
- demeter dependencies already installed
- navigate to root project folder
- "vault.env" exists on cwd (typically root project folder)
- run
node ./demeter/index.js {dev,stg,prod}
Templates folder pattern:
{root_app_folder}/config/{dev,stg,prod}/**/*.j2
Lookup method spec:
SOME_ENV=lookup_kv("{VAULT_ENGINE}", "{VAULT_SECRET_NAME}:{SECRET_FIELD_KEY}")
TODO:
- Should be able to run "get kv" asynchronously
- Lotta error handling on "...Sync()" calls
- Vault variables standarization esp. for VAULT_ENGINE, VAULT_SECRET_NAME, SECRET_FIELD_KEY
- unit test