0
votes

I am trying to create an extension using node api which publishes a path variable on completion. I did set outputVariables in task.json and tried to use both

tl.setVariable('outVar1', 'outVal1'))
tl.setTaskVariable('outVar1', 'outVal1'))

task.json (only outvariable section):

"OutputVariables": [
        {
            "name": "outVar1",
            "description": "This publish a output variable."
        }
    ],

I tried printing it in the subsequent steps in the same job using all the recomended constructs

$(taskName.outVar1)
$taskName.outVar1
$outVar1
$(outVar1)

But the variable is not visible. I also printed all the environment variables and the variable is not present there. Is someone able to create an extension which outputs a variable successfully?

1

1 Answers

0
votes

You don't need to declare an output variable fro this purpose.

Just set the variable:

tl.setVariable("varNamr","varValue", false);

The fasle indicate that is not a secret variable.

In the enxt steps you can use the variable wirh $(varName).