feat(cli): Add cli and context options to pass dotfile script env vars #1504
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My use case involves dotfile install scripts parametrized with secrets, which I don't want to commit to my dotfiles repository. Environment variables seemed like the obvious choice to pass secrets down to the agent during dotfile installation. I've done this by adding the
DOTFILES_SCRIPT_ENV_FILES
context option, and the equivalent--dotfiles-script-env-file
option to theup
command. For completeness sakes I've also added--dotfiles-script-env
, which I recommend against using for secrets since this is logged.Let me know what you think.
I do also have another branch with an
--dotfiles-script-env-var
option which would pass-through the corresponding environment variable defined in the environment invokingdevpod-cli
, but I didn't want to add bloat.Here is me testing this PR:
Contents of dotfiles setup.sh:
Configuring .env files and context:
up
output, you can see the vars are defined in the install script: