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

Allow to use env variables in Ecotone's Symfony Config #392

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

dgafka
Copy link
Member

@dgafka dgafka commented Oct 17, 2024

Description

Allow to use env variables in Ecotone config for Symfony.
It will now work for Symfony, just like it does for Laravel.
Therefore the environment variables will be resolved during container build and use for preparing Ecotone's configuration.


Using environment variables is safe as long as container is build with expected variables. If we will for example build the container, dump it into Docker Image, and the run it in container with different environment variables - only the envs used during build will be used.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

@dgafka dgafka changed the title Allow to use env variables in Ecotone config in Symfony Allow to use env variables in Ecotone's Symfony Config Oct 17, 2024
@dgafka dgafka merged commit 7d7fe6e into main Oct 17, 2024
59 checks passed
@dgafka dgafka deleted the feature/use-envs-in-config branch October 17, 2024 20:07
@dgafka
Copy link
Member Author

dgafka commented Oct 17, 2024

cc: @lifinsky

@lifinsky
Copy link
Contributor

@dgafka But env processors int:, bool:, etc will not work.

@lifinsky
Copy link
Contributor

I once also wanted to make such an PR, but I didn’t like that it wouldn’t be possible to work with bool or int parameters in the config.

@dgafka
Copy link
Member Author

dgafka commented Oct 18, 2024

@lifinsky this what we can achieve with reasonable amount of time.
In general that would require refactor to make ServiceConfiguration an Service in DI, then we could inject any config to that at run time. Yet it means compile phase would need to change and not use it at all. Yet we do use it in order to make performance smoother as most of the configuration is basically done and ready to execute (no need for run time reconfigurations)

So at this moment, that's fair enough trade off, which will work for particular cases.

@lifinsky
Copy link
Contributor

@dgafka #399

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.

2 participants