Skip to content

More support for variable substitution in tasks.json #163483

@joshuaphelpsms

Description

@joshuaphelpsms

There is current support for variable substitution in tasks.json, however it is limited to command, args, and options. It would be great to use this in other places throughout the tasks.json file.

Our team hit this when trying to use variable substitution in the docker-run task. We wanted to use the git branch name as the image tag and our work around was using find and replace.

ex:

{
      "type": "docker-run",
      "label": "docker-run: debug",
      "dependsOn": ["docker-build"],
      "python": {
          "file": "path_to/app_entry_point.py"
       },
      "dockerRun": {
          "image": "someregistry.io/someimage:${BRANCH}"  
      }
}

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitytasksTask system issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions