rliebz / tusk

The modern task runner
https://rliebz.github.io/tusk/
MIT License
237 stars 21 forks source link

Load(source) environment variables from a file as configuration file. #98

Closed elyoni closed 3 months ago

elyoni commented 10 months ago

Hello, and thank you. Your application is one of the best, and I use it every day for many of my projects. I'd like to suggest a new feature to load environment variables from a file. With this feature, we can use the same tusk.yml file for every project and only need to change the environment variables file.

The configuration file name will be specified at the top level of the tusk.yml file. Additionally, it can be optional; if the file exists, it will be loaded.

Thanks

smyrman commented 10 months ago

Potential workaround when the issue is ongoing.

What we do four our own tusk file, is that for tasks that needs it, we source the file through the shell:

  run:
      - |
        set -e
        source ${resources}/docker-compose.gotest.env

This works if the env file is simple enough, but it does support comments with a # prefix..