Executing task step conditionally like "passed"


#1

Hello,

It seems that the “put” and “get” steps can be executed on condition that a certain previous job has “passed”. How can I do the same for the “task step”?

Blockquote
jobs.Vault Unseal.plan[0].task.vault-init has invalid fields specified (passed)
Blockquote


#2

task is also a step same as put step, so I think you should be able to use task where you can use put.


#3

Hello,

Yes I thought so too. But it doesn’t parse…

Blockquote

jobs has invalid fields specified (passed)


#4

You can’t. task steps don’t support the passed param (they only apply to resource versions, thus can only be used in get steps).

What is the goal that you are trying to accomplish? Does the execution of the task depend on whether there is a particular new resource version?


#5

I think there is some misunderstanding. If you can provide a piece of sample code, that would be helpful to understand your question.


#6

Hello,

I see. Well there is a sequential nature in my jobs in that one job cannot start until the previous has finished. Within a job I can set up a plan that is sequential however not within the context of the pipeline in terms of the serial nature of the jobs. I can use a resource get as a first job step and trigger the sequence but I cannot just trigger the sequence based on a previous job being “passed”. This is limiting - or rather - I perceive this as limiting. Should I just create a dummy resource just for this purpose?


#7

Hi,
I had the same problem, and after some digging I came up with a solution that I’ve documented here: https://github.com/lorands/concourse-samples/blob/master/conditional/README.md

I hope this helps.

Regards,
L.


#8

That’s cool. Thanks for sharing it’s helpful!