I want to config my scenario using config file. However, some parameters in certain scenarios, I would like to set dynamically. For example in the config below for scenario 1, I would like to set start rate and target dynamically by env variables or from CLI when running the script. How can I to achieve this? Is there an example somewhere?
Config files are static JSON files, and there you can’t use environment variables. However, you can easily achieve that migration to the options inside your scripts.
Hey @olegbespalov
I need to use config file, because I want to be able to run same code with different configuration.
I only need to overwrite certain values in the code if they are provided in env variables. Is it possible?
I think what I need is here: Options reference
Because if I provide env variables or CLI options it will overwrite the config file. Right? However, I do not know how to overwrite certain stages for particular scenario. Is there any example?
As shown in Scenario config file - #2 by nedyalko you can load the config file as a normal file, parse it from JSON and then set it to export const options. You can also just before that change w/e options you want.
This also (as shown there) can be done only for some option keys - you don’t need to write the whole configuration, as needed for --config.
And you can use env variables to choose the “configuration file” an then what the replace for your needs.