Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add system env variable expansion to envVars function #186

Merged
merged 3 commits into from
Mar 24, 2024
Merged

Conversation

umputun
Copy link
Owner

@umputun umputun commented Mar 24, 2024

The function envVars has been updated to enable the application to also read system environment variables, in addition to CLI and env file variables. This change includes an update of the function's comment to reflect the new behavior, and the addition of new test cases to validate the feature. CLI variables override env file variables, which in turn override system environment variables if they share the same name.

see discussion #184

The function `envVars` has been updated to enable the application to also read system environment variables, in addition to CLI and env file variables. This change includes an update of the function's comment to reflect the new behavior, and the addition of new test cases to validate the feature. CLI variables override env file variables, which in turn override system environment variables if they share the same name.
Copy link

cloudflare-pages bot commented Mar 24, 2024

Deploying spot-site with  Cloudflare Pages  Cloudflare Pages

Latest commit: 91245e9
Status:⚡️  Build in progress...

View logs

@coveralls
Copy link

coveralls commented Mar 24, 2024

Pull Request Test Coverage Report for Build 8411187610

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 84.572%

Totals Coverage Status
Change from base Build 8407895161: 0.02%
Covered Lines: 2686
Relevant Lines: 3176

💛 - Coveralls

@umputun
Copy link
Owner Author

umputun commented Mar 24, 2024

@rahfar - this PR adds support for the OS environment. Give it a try (merged to the master), and let me know if it works for you.

to clarify: in both CLI and env file you can use smth like -e var1=$HOME (also ${HOME}) or - var1: $HOME

@umputun umputun merged commit dad40bb into master Mar 24, 2024
4 of 5 checks passed
@umputun umputun deleted the expand-os-env branch March 24, 2024 18:09
@rahfar
Copy link
Contributor

rahfar commented Mar 24, 2024

tried it, and there are 2 points that holds me to use it instead of load_secrets_to_spot.sh && spot; rm spot.db:

  1. env vars are printed in logs
  2. (not very important) would like to have MYSECRET: $MYSECRET inside playbook, instead of in cli arg or env.yml

but in general, it is a good feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants