Using Azure Devops 2019 Server (On-Premises)
So I want my agentless job, User Intevention task named "Install" to run only when IsServiceInstalled
variable is 0. I'm able to use this variable only within same job (agent), but not within other (agentless).
No matter what I do, I get an exception stating something like:
Exception Message: Unrecognized value: 'dependencies'. Located at position 21 within expression: and(succeeded(), eq(<whatever i try to put here>, 0))
Code that sets variable:
#Sets IsServiceInstalled to determine if service must be installed or updated
Get-Service "$(RabbitMQServiceName)" -ErrorAction SilentlyContinue
if ($?) {
echo "##vso[task.setvariable variable=IsServiceInstalled;isOutput=true]1"
} else {
echo "##vso[task.setvariable variable=IsServiceInstalled;isOutput=true]0"
}
- I'm aware that I can use "depdendencies." to access that variable. Use the output variable from a job in a condition in a subsequent job. But I don't get an option to name Job.
- I'v ran my deployment with
system.debug=true
and found out[SYSTEM_JOBNAME] --> [__default]
- so I tried setting usingand(succeeded(), eq(dependencies.__default.Outputs['IsServiceInstalledTask.IsServiceInstalled'], 0))
- yeah, I get exceptionUnrecognized value: 'dependencies'
- and no surprise as I never specified a dependency and I don't see where can I specify it within UI. - I don't have an option to set Job Name, so i'v tried setting various values I found within debug log (__default being the jobname I want my output variable from):
Stage_cb7edb91b40b4747845ae3564bf62723_2_9.Phase_1.__default...
,Phase_1.__default...
or__default...
No matter what I try, I get the same Unrecognized value exception.
The great thing about writing a question is that I'v found the answer in official documentation: NOT SUPPORTED in classic pipeline.
Let me quote:
From Use output variables from tasks and click on Classic Tab