Skip to content

Support for referencing feature option values in containerEnv #164

Description

@rickardgranberg

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",
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalStill under discussion, collecting feedback

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions