-
-
Notifications
You must be signed in to change notification settings - Fork 763
Open
Description
There are some cases where task: is called under cmds: and the task needs to be conditionally run. Take the following as an example:
---
version: '3'
tasks:
python:requirements:
deps:
- :install:software:python
run: once
cmds:
- task: python:requirements:poetry
- task: :{{if eq .REPOSITORY_TYPE "ansible"}}common:python:requirements:ansible{{else}}donothing{{end}}
status:
- '[[ "${container:=}" == "docker" ]]'
I'm currently getting around the issue by having a task called donothing that gets called when the task should not run. It would be nice if we could conditionally run tasks somehow. Maybe something like this:
---
version: '3'
tasks:
test:
cmds:
- task: anothertask
when:
sh: '[[ "$CONTAINER" == 'docker' ]]'
TheSimpleZ, kitos9112, ambis, kevbook, robinjoseph08 and 53 morethinkgos, fabiomarinetti and onedr0p
Metadata
Metadata
Assignees
Labels
No labels