Environment Variables - for mono repo - at the repo, or sub-project level? #283
Select Release Productnuxt-base layers in support of the low-volume filings SummaryShould there be 1 common env file for the whole repo to use, or should it be at the sub-project level? Current mono-repo goals are to service a singular business / partner area. ConsensusInitial implementation will be to have the envvars at the root level covering all the deployed filings needs. Basic ExampleDefining if the env description is at the root /devops/vaults.envversus /web/{product-A}/devops/vaults.env
/web/{product-B}/devops/vaults.envReviewing the current products, they look identical except for MotivationThe current CD does not support executing from the root of the repo leveraging the npm workspace definitions dues to where the devops directory lookup is expected. The current CD set the workspace to the sub-project to execute, but this does not leverage the workspace features need to keep the monorepo lean. DrawbacksSub-projects may have envvars that are not used in their project. Adoption StrategyThere are some legacy layouts / envvar naming being used, so those projects would need to be changed. This does not seem like a significant issue that should affect the final decision. Future AlignmentVite is adopting support for monorepos. Its target is to overtake turbo/nx and be package manager agnostic adopting antfu's ni. Unresolved QuestionsNo response |
Replies: 2 comments 6 replies
|
I like the idea of having one vaults.env at the root, but it might be good if the CD also checks the sub project for something like 'vaults.overrides.env' so that we can easily override any env variable for a sub project if we need to in the future (i.e. base url, ldarkly, keycloak or something) |
ConsensusInitial implementation will be to have the envvars at the root level covering all the deployed filings needs. Basic ExampleDefining if the env description is at the root /devops/vaults.env |
Consensus
Initial implementation will be to have the envvars at the root level covering all the deployed filings needs.
Basic Example
Defining if the env description is at the root