k1LoW / runn

runn is a package/tool for running operations following a scenario.
https://runn.run
MIT License
404 stars 30 forks source link

[Feature Request] Allow passing enviroment variables by file #941

Closed okazaki-kk closed 1 month ago

okazaki-kk commented 1 month ago

Hello! When testing with runn in CLI mode in multi environments, it's tedious to switch some environment variables for each environment like this.

ENV1=STAGING_ENV1 ENV2=STAGING_ENV2 ENV3=STAGING_ENV3 runn run test.yaml.   # staging
ENV1=RPOD_ENV1    ENV2=PROD_ENV2    ENV3=PROD_ENV3    runn run test.yaml    # production

So, I want to manage environment variables by file and pass them.

my image

runn run test.yaml -e staging.yaml     #  staging
runn run test.yaml -e prod.yaml        # production

If possible, I think It would be useful if environment variables could be specified in a yaml file or .env file. If you have any other ideas, please let me know 🙏 .

ref: https://github.com/postmanlabs/newman?tab=readme-ov-file#newman-run-collection-file-source-options -e option

k1LoW commented 1 month ago

If it were to be implemented, it would be better to add the same --env-file option as the docker command.