Stage of pipeline gets skipped even tho it doesnt have any conditions
Asked Answered
S

2

5

Guys Im currently working on an azure devops yaml pipeline, and i have a weird problem. For some reason on of my stages (marked in red) gets skipped, even tho it doesnt have any conditions definded. structure of yaml pipeline Heres the code of the stage and the previous stage:

Stage before the one that gets skipped: stage before

Stage that gets skipped: Code of skipped Any Ideas what the problem could be?

Sublimity answered 25/3, 2022 at 13:58 Comment(1)
Don't post screenshots of code. Post the actual text.Lapful
M
6

The default behaviour if you don't specify a condition is to only run if all previous steps/jobs/tasks in the dependency tree have succeeded. And since you have a task in the previous steps which is skipping, the following stage is not running.

I think you can add something like this:

dependsOn: Download_from_source
condition: succeeded('Download_from_source')
Mallarme answered 26/3, 2022 at 14:45 Comment(0)
P
3

The reason is exactly what @James wrote, but to solve it you need to add the following condition (in the Upload_to_Target stage):

condition: and(not(failed()), not(canceled()))
Pass answered 27/3, 2022 at 9:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.