Open
Description
We have a case where we need to define a Container env variable, that depends on the value of an option.
Although possible to inject the env variable in .profile, .bashrc or similar in install.sh
, this causes an issue when using the build image in CI/CD, specifically in Azure Pipelines when bash is launched with the --noprofile --norc
flags.
As an example:
{
"id": "some-feature",
"version": "0.0.1",
"options": {
"version": {
"type": "string",
"proposals": [
"latest"
],
"default": "latest",
"description": "Select or enter a version"
}
},
"containerEnv": {
"FEATURE_HOME": "/opt/feature/<need-version-here>/bin",
}
}
Maybe something similar to the pre-defined variables ${localEnv:VARIABLE_NAME}
would work, like ${option:optionName}
?
In context:
{
"id": "some-feature",
"version": "0.0.1",
"options": {
"version": {
"type": "string",
"proposals": [
"latest"
],
"default": "latest",
"description": "Select or enter a version"
}
},
"containerEnv": {
"FEATURE_HOME": "/opt/feature/${option:version}/bin",
}
}