Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Former Member
5 years ago[21] Conditionnal injection (jinja?)
Hi CLI-team,
First of all, thanks for the CLI. v1 already changed our way of working at Cortexia.
Thanks for the v2 which allows us to already clean and consolidate our scripts by simply upgrad...
1P_Simon
1Password Team
5 years agoHi Emmanuel,
Thank you very much for writing such a detailed description!
We really like your idea of templating the .env file. We even have done a first step of that in the op inject command already: allowing variables in the reference, so you can use the same configuration for multiple different environments. You can find it described here: https://developer.1password.com/docs/cli/guides/config-files#step-4-differentiate-between-environments . We're planning on adding the same variable support to op run for environment files as well. How do you feel about that?
Regarding your use case of having a default configuration that's overloaded with values specific to a single environment, would a setup with multiple environment files, e.g. defaults.env and production.env work for you? When you pass multiple environment files to op run, variables defined in the second file take precedence over variables defined in the first file.
op run --dotenv-file defaults.env --dotenv-file production.env -- ./run-your-app
Would love to hear your thoughts and iterate on this further! Thank you so much for all your feedback so far! ❤️
Cheers,
Simon