teller icon indicating copy to clipboard operation
teller copied to clipboard

Add process_env provider

Open kevbook opened this issue 2 years ago • 1 comments

Related Issues

https://github.com/tellerops/teller/issues/116

Description

Add process_env provider. Load the environment variables from the parent process as needed.

Example Config

providers:
  process_env:
    env_sync:

    env:
      ETC_DSN:

Checklist

  • [ ] Tests
  • [x] Documentation
  • [x] Linting

kevbook avatar Jul 30 '22 17:07 kevbook

Hey @kevbook, Just summarize the open issues in this PR:

  1. remove env_sync from the config example meaning by default the env_sync will not generate when running teller new. but pkg/providers/process_env.go keep the GetMapping function to support env_sync in some usecases
  2. Return errors (not nil) in places that we not implement the logic (see my change in suggestions), you also need to import fmt see your CI results
  3. Add process_env_test.go

thanks for your help

kaplanelad avatar Aug 09 '22 06:08 kaplanelad

I've updated the code, wizard_template and the README with usage.

I don't really write go, so I am not sure how tests can be written. But I can take a stab at process_env_test.go if you'd like to review the code.

kevbook avatar Aug 30 '22 05:08 kevbook