ArtifactSrc: Use env variables to parametrize artifact source name
Current status
Currently, the artifact sources in input_artifact
should be statically defined in each scenario.
Desired feature
It would be a great add-on if environment variables could be used in these artifact sources. Indeed the scenario could thus be much simplified (namely its naming) when deployments with a lot of common parameters are to be applied.
Typical use case
Let's assume that we want to configure a POD for each of the following local files:
scenarios_config
config
config1
config2
config_other
Currently
my_scenario_config1.yml
...
scenario_steps:
config:
project: config
input_artifact:
local_files:
- scenarios_config/config/config1: vars/config
...
my_scenario_config2.yml
...
scenario_steps:
config:
project: config
input_artifact:
local_files:
- scenarios_config/config/config2: vars/config
...
my_scenario_config_other.yml
...
scenario_steps:
config:
project: config
input_artifact:
local_files:
- scenarios_config/config/config_other: vars/config
...
A lot of redundancy and copy-pastes (with the incumbent maintenance issues), with the user having to type-in a long scenario name, i.e. POD
in {my_scenario_config1, my_scenario_config2, my_scenario_config_other}
Target
my_scenario.yml
...
scenario_steps:
config:
project: config
input_artifact:
local_files:
- scenarios_config/config/config{{ lookup('env','CONFIG_TYPE') }}: vars/config
...
The user has to provide an additional pipeline variable CONFIG_TYPE
in {1, 2, '_other'}
just after setting POD
= my_scenario
.