kurtbuilds / modenv

A CLI to easily manage .env files and keep them consistent. It is simple, fast, error resistant, and composable.
MIT License
54 stars 2 forks source link

docker compose and GitHub actions files #8

Open dancergraham opened 7 months ago

dancergraham commented 7 months ago

Hello,

I need to handle .env files as well as associated environment variable assignment in docker-compose.yml and github actions files. It would be great to be able check for instance that all environment variables specified in the docker-compose file also exist in the .env file, and to add them if needed in a MY_ENV_VAR: $MY_ENV_VAR format in the environment: section.

Would this feature fit in the scope of this project? Would it make sense to allow extensions or command line options of this type?

kurtbuilds commented 7 months ago

This project is primarily about checking consistency between .env files.

If I understand you correctly: are you asking about checking whether all variables in a .env file already exist in the environment? To me, that seems like a separate purpose. What's the advantage of having both functionality in the same tool? If it's part of a separate tool, definitely the env file parsing could be re-used between the projects.

dancergraham commented 7 months ago

The advantage of having them together for me would be that it is a single action to add environment variables with consistent spelling across these files. I get build failures because of typos or values being correctly placed in one file but forgotten in another file.

kurtbuilds commented 7 months ago

Oh! Basically using docker compose/GH actions yaml as a data source.

Yeah! I love that idea. PRs welcome!