-
Notifications
You must be signed in to change notification settings - Fork 56
Allow to transfer parameters as ENV variables to task #252
Comments
I guess this relates to #237 and should be possible to implement since the rendering takes place before the task is created. So the proposed |
Hi @Rabattkarte, |
Sounds like a good plan @Rabattkarte. I'm the author of #237 and run into a similar issue today. I'm doing the replacetokens from a template that receives the 'data' als parameters. In template files you cannot specify variables (unless used as a variables-template, but that's another thing). Specifying a mappingtable would be very handy for me, as I need to replace just 3 tokens. |
I just solved it by using an external variables file which I generate in a previous step using Bash. Works too, but a bit cumbersome. |
Hi @Rabattkarte, @kwaazaar, - task: qetza.replacetokens-dev.replacetokens-task.replacetokens@4
displayName: 'inline variables'
inputs:
targetFiles: '*.json'
inlineVariables: |
myParam1: '${{ parameters.myParam1 }}'
myParam2: '${{ parameters.myParam2 }}' |
In our pipelines, we have the following syntax on multiple occasions. This is because we are using the
replacetokens
task in pipeline step templates, where you are unable to define avariables:
block and we must not call templates with magic numbers.Please have a look at the following example:
replaceTemplate.yaml
My proposal would be a input parameter similar to the Bash task's
bashEnvValue:
, using the example above:replaceTemplate.yaml
The text was updated successfully, but these errors were encountered: