-
Notifications
You must be signed in to change notification settings - Fork 854
Actions inside if statements #1255
Copy link
Copy link
Closed
Description
Problem
There may or may not be a problem. It depends on whether the desired behavior is already supported.
Desired behavior
Dagger should support conditional execution of actions, using the standard if statement in CUE. Importantly, it should be possible to reference the output of other tasks in the if statement, and have task dependency be respected.
For example:
arch: docker.#Run & {
script: “uname -m > /arch”
output: files: “/arch”: _
}
if arch.output.files.”/arch”.contents == “x86_64\n” {
ftw: docker.#Run & {
script: “echo x86 FTW!”
}
}
Note that the ftw action itself does not reference arch, but the surrounding if statement does. Therefore, there is a dependency between them.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels