config:
target: "https://some-site.com"
This my current setup. the target is static. I want to make it variable, either through a command line argument or environment argument.
For Example:
config:
target: "{{ target_site }}"
config:
target: "https://some-site.com"
This my current setup. the target is static. I want to make it variable, either through a command line argument or environment argument.
For Example:
config:
target: "{{ target_site }}"
Copyright © 2021 Jogjafile Inc.
Three options:
Option 1.
processEnvironmentUse
$processEnvironmentto get a variable from an environment variable:And run with
TARGET_URL=https://some-site.com artillery run scenario.ymlOption 2.
--variablesDefine your YAML like this:
And then run your scenario by passing in the
targetUrlvariable:artillery run scenario.yml --variables '{ "targetUrl": "https://some-site.com" }'Option 3.
--dotenvCreate a
.envfile with the URL:Then, create your scenario as in the first option.
Finally, run your scenario with:
artillery run scenario.yml --dotenv <path_to_dotenv_file>