When working and deploying AB apps to different IO workspaces, different environment specific configurations are required as input for the actions. The environment specific configs are stored in the .env file, however there is only one file, so manual changes are required to the file each time. This is not only cumbersome but also error prone, i.e. when forgetting to update the .env file and deploying the wrong config. Some custom scripted approaches exists for this common requirement, but a proper product solution should be provided.
To support workspace specific configurations the following structure and functionality is proposed:
.env: configuration for the currently selected workspace (via aio app use)
`.env.: multiple env files for all workspaces of the IO project, e.g. 'develop', 'develop2', 'stage', 'prod', etc. which contain the actual configuration for each workspace
env.global: optionally a file which contains global env configuration properties valid for all workspaces
When a workspace is switched, e.g. via aio app use, then the .env file content is overwritten with the content of the .env.<workspace-name> file
Optionally (if implemented) the content of the .env.global is merged into the new .env file
This relatively simple functionality could be implemented in the aio app use plugin command, as it already modifies other configuration files anyway (.aio and app.config.yaml)
Actual Behaviour
Currently only one .env file exists for all workspaces which prevents proper workspace specific configurations
Expected Behaviour
When working and deploying AB apps to different IO workspaces, different environment specific configurations are required as input for the actions. The environment specific configs are stored in the
.env
file, however there is only one file, so manual changes are required to the file each time. This is not only cumbersome but also error prone, i.e. when forgetting to update the.env
file and deploying the wrong config. Some custom scripted approaches exists for this common requirement, but a proper product solution should be provided.To support workspace specific configurations the following structure and functionality is proposed:
.env
: configuration for the currently selected workspace (viaaio app use
)env.global
: optionally a file which contains global env configuration properties valid for all workspacesaio app use
, then the.env
file content is overwritten with the content of the.env.<workspace-name>
file.env.global
is merged into the new.env
fileaio app use
plugin command, as it already modifies other configuration files anyway (.aio
andapp.config.yaml
)Actual Behaviour
Currently only one
.env
file exists for all workspaces which prevents proper workspace specific configurationsPlatform and Version
Sample Code that illustrates the problem
On a brief look into the code, this could be a place to add this feature: https://github.com/adobe/aio-cli-plugin-app/blob/70b9a426c7972c20cced304254d4c84c73fcd78a/src/lib/import.js#L606