blindnet-io / devrel-management

Open Management of everything related to Developer Relations at blindnet.
7 stars 1 forks source link

build(PCE): automate definition of environment variables for development #74

Closed m4rk055 closed 2 years ago

m4rk055 commented 2 years ago

For a better developer guide in devkit projects, simplify usage of environment variables. One option is to have default environment variables defined in an env file and run e.g.

export $(xargs <.env-dev)
nweldev commented 2 years ago

I redefined the scope of this issue to PCE only, as discussed with @m4rk055.

The same approach should still be favoured for other backend projects IMHO (ping @TheKinrar).

TheKinrar commented 2 years ago

I do not understand how this is better than having default values for env variables, internally in the project, as this requires an extra step to run the component

nweldev commented 2 years ago

IMHO, it isn't :wink: Convention over configuration is a better approach in most cases.

For the PCE, I believe (but this would need to be confirmed by @m4rk055) a "default configuration" would not be really relevant as this is really important information which have to be set by the client (e.g. there is no default company name). Those "default values" are for tutorials and demonstrations only, and could change depending on what this tutorial or demonstration actually requires.

m4rk055 commented 2 years ago

@TheKinrar I was considering what you said. Having certain env variables defined internally is ok but some of them are directly related to configuration of other components (e.g. database password). In that case, we have to synchronize the values between multiple projects which is simpler to do in an env file than changing the sources. The step to export the env variables can certainly be automated.

TheKinrar commented 2 years ago

Sure! All I'm saying is, we should not remove default values from the components, even if they're also in a default env file. An environment file makes no difference to the component after all if we're just importing it before start.